Have your administrator create a database table for storing
your session data using one of the following data definition language
(DDL): For DB2:CREATE TABLE <SchemaName>.sessions (
ID VARCHAR(128) NOT NULL ,
PROPID VARCHAR(128) NOT NULL ,
APPNAME VARCHAR(128) NOT NULL,
LISTENERCNT SMALLINT ,
LASTACCESS BIGINT,
CREATIONTIME BIGINT,
MAXINACTIVETIME INTEGER ,
USERNAME VARCHAR(256) ,
SMALL VARCHAR(3122) FOR BIT DATA ,
MEDIUM LONG VARCHAR FOR BIT DATA ,
LARGE BLOB(2M)
)
For Oracle:CREATE TABLE SESSIONS (
ID VARCHAR(128) NOT NULL ,
PROPID VARCHAR(128) NOT NULL ,
APPNAME VARCHAR(128) NOT NULL,
LISTENERCNT SMALLINT ,
LASTACCESS INTEGER,
CREATIONTIME INTEGER,
MAXINACTIVETIME INTEGER ,
USERNAME VARCHAR(256) ,
SMALL RAW(2000),
MEDIUM LONG RAW ,
LARGE RAW(1)
)
If the Web container custom property UseOracleBLOB is set to
true then:CREATE TABLE SESSIONS (
ID VARCHAR(128) NOT NULL ,
PROPID VARCHAR(128) NOT NULL ,
APPNAME VARCHAR(128) NOT NULL,
LISTENERCNT SMALLINT ,
LASTACCESS INTEGER,
CREATIONTIME INTEGER,
MAXINACTIVETIME INTEGER ,
USERNAME VARCHAR(256) ,
SMALL RAW(2000),
MEDIUM BLOB,
LARGE RAW(1)
)
Note:
- At run time, the session manager accesses the target table using
the identity of the J2EE server in which the owning Web application
is deployed. Any Web container that is configured to use persistent
sessions must have both read and update access to the subject database
table.
- HTTP session processing uses the index defined using the CREATE
INDEX statement to avoid database deadlocks. In some situations,
such as when a relatively small table size is defined for the database,
DB2 may decide not to use this index. When the index is not used,
database deadlocks can occur. If database deadlocks occur, see the
DB2 Administration Guide for the version of DB2 you are using for
recommendations on how to calculate the space required for an index
and adjust the size of the tables that you are using accordingly.
- It might be necessary to tune DB2 to make efficient use of the
sessions database table and to avoid deadlocks when accessing it.
Your DB2 administrator should refer to the DB2 Administration Guide
for specific information about tuning the version of DB2 that you
are using.
-
During run time, the session manager may create
an entry in the database for each web module of the application. This
row of data is used internally for session management purposes, such
as in session invalidation. Do not be concerned with this entry. It can be overlooked. ![[Updated in February 2011]](../../deltaend.gif)
feb2011