Session management

The time a client is connected to a server is called a session. Each time a client logs into a SQL database using a Dexterity-based application, a unique session ID is generated to identify that session. If multiple sessions are run from a single client computer simultaneously, each session is assigned its own unique session ID. If a client logs out and logs back into a database, the new session will be assigned a different session ID.

Dexterity uses a table named DEX_SESSION to generate the session ID. This table must be located in the standard SQL Server database named tempdb, and be defined to include the following columns with the specified attributes:

[spacer]

Column name

Type

Length

Nulls

Identity column

session_id

int

4

0

YES

sqlsvr_spid

small int

2

0

NO


This table’s primary key consists of the session_id column. When a new session is established, the ID used by the server to track that session is added to the sqlsvr_spid column. Using this information, a session ID is generated, stored in the session_id column and returned to Dexterity.

Session tables

In addition to creating a session ID for each session, Dexterity creates a table in the standard SQL Server database named tempdb, and names the table DLxxxxxxxxxx, where xxxxxxxxxx is the session ID. This table will remain open until the session associated with that session ID is closed.

This session table is used to verify whether a specific session is still active. If a session table for a given session ID doesn’t exist, then that session is no longer connected to the server, and any locked records associated with that session ID can be unlocked.


Documentation Feedback