Export (0) Print
Expand All

Session-State Database Schema

Visual Studio .NET 2003

For the database implementation of the ATL Server session-state services, the CDBSessionServiceImplT class communicates with a database through CDBSession. This class template in turn defaults to using CDefaultQueryClass to provide the SQL queries used for accessing the database. CDefaultQueryClass expects the database to have two tables, one for storing session variables named SessionVariables, and one for storing session reference information named SessionReferences. The schema of the two tables is defined as follows:

SessionVariables

Column Name Type Description
1 SessionID char[MAX_SESSION_KEY_LEN] Session name
2 VariableName char[MAX_VARIABLE_NAME_LENGTH] Variable name
3 VariableValue varbinary[MAX_VARIABLE_VALUE_LENGTH] Variable value

SessionReferences

Column Name Type Description
1 SessionID char[MAX_SESSION_KEY_LEN] Session name
2 LastAccess Datetime Date and time of last access
3 RefCount INT Count of current references on this session
4 TimeoutMS Int Timeout value for the session

If SQL Server is being used to host the session database, the SQL script, SessionServices.sql, which can be found in the \VC7\bin directory of your Visual Studio installation, can be used to create the necessary tables.

As an implementation class, CDBSessionServiceImplT serves a behind-the-scenes role and should be used in your code only as a template parameter to CSessionStateService. See Providing Session-State Services for more information.

See Also

Session-State Services | CMemSessionServiceImpl | Session-State Reference

Show:
© 2014 Microsoft