CreateSession

KCM Core creates a new session and associates it with the active job. Every session has a unique storage area used to store data associated with that session. For more information on sessions, see KCM Core sessions.

The command CreateSession fails if the active job is already associated with a session.

Syntax

CreateSession
   Persistent(True or False);

Parameters

Persistent: Optional. Indicates whether the session should be automatically removed when the job ends. If this parameter is not specified, the session is not automatically removed.

The command CreateSession creates a directory structure in the session folder. If the session is persistent this structure is only removed when the session is closed by the command CleanupSession or when it is expired using the command ExpireSessions. Scripts can access this directory through the variable _sessiondir.

The command CreateSession generates a unique session identifier and puts this in the variable _sessionid. Subsequent jobs submitted with this session identifier are automatically associated with the session. The business application developer is responsible for returning the session identifier to the application and passing it back on subsequent calls. All calls with the same session identifier are serialized by KCM Core.