Last modified: January 09, 2012
Applies to: Windows | Windows Server
The JetDupSession function starts a session, and initializes and returns an ESE session handle (JET_SESID). Sessions control all access to the database and are used to control the scope of transactions. The session can be used to begin, commit, or abort transactions. The session is also used to attach, create, or open a database. The session is used as the context for all DDL and DML operations. To increase concurrency and parallel access to the database, multiple sessions can be begun.
JET_ERR JET_API JetDupSession( __in JET_SESID sesid, __out JET_SESID* psesid );
The session to use as the source for duplicating or beginning the session.
A pointer to the variable that the session handle initializes on successful return.
This function returns the JET_ERR datatype with one of the following return codes. For more information about the possible ESE errors, see Extensible Storage Engine Errors and Error Handling Parameters.
The operation completed successfully.
It is not possible to complete the operation because all activity on the instance associated with the session has ceased as a result of a call to JetStopService.
It is not possible to complete the operation because the instance associated with the session has encountered a fatal error that requires that access to all data be revoked to protect the integrity of that data.
This error will only be returned by Windows XP and later releases.
One of the parameters provided contained an unexpected value or contained a value that did not make sense when combined with the value of another parameter.
It is not possible to complete the operation because the instance associated with the session has not been initialized yet.
The operation failed because memory could not be allocated.
The number of sessions the engine will allow the client to start is limited. This value can be changed using JetSetSystemParameter with the JET_paramMaxSessions constant. The default number of sessions is 16. See System Parameters for details about JET_paramMaxSessions.
It is not possible to complete the operation because a restore operation is in progress on the instance associated with the session.
It is not possible to complete the operation because the instance associated with the session is being shut down.
On success, the session handle is initialized, and may be used for database operations.
On failure, there are no available sessions or a new session was unable to be initialized.
Requires Windows Vista, Windows XP, or Windows 2000 Professional.
Requires Windows Server 2008, Windows Server 2003, or Windows 2000 Server.
Declared in Esent.h.