HTTP Session Database (httpSessionDatabase)

Controls how HTTP sessions are persisted to a database.

NameTypeDefaultDescription

dataSourceRef

string
Required

The identifier of the data source the session manager should use to persist HTTP session data.

skipIndexCreation

boolean

false

Set this property to "true" to disable index creation on server startup. This custom property should only be used if you want to manually create your own database indices for session persistence. However, it is recommended that you let session manager create database indices. Before enabling this property, make sure that the correct index does exist on your session database.

tableName

string

sessions

The database table name.

useMultiRowSchema

boolean

false

When enabled, each session data attribute is placed in a separate row in the database, allowing larger amounts of data to be stored for each session. This configuration can yield better performance when session attributes are very large and few changes are required to the session attributes. When disabled, all session data attributes are placed in the same row for each session.

Advanced Performance

noAffinitySwitchBack

boolean

false

Set this property to "true" to maintain affinity to the new member even after original one comes back up. When a cluster member fails, its requests routed to a different cluster member, and sessions are activated in that other member. Thus, session affinity is maintained to the new member, and when failed cluster member comes back up, the requests for sessions that were created in the original cluster member are routed back to it. Allowed values are true or false, with the default being false. Set this property to true when you have distributed sessions configured with time-based write. Note that this property has no affect on the behavior when distributed sessions are not enabled.

onlyCheckInCacheDuringPreInvoke

boolean

false

A value of true indicates that the last access time of a session should only be updated if a request gets the session. A value of false indicates that the last access time of a session should be updated upon every request. Changing this value can improve performance in some environments.

optimizeCacheIdIncrements

boolean

true

If the user's browser session is moving back and forth across multiple web applications, you might see extra persistent store activity as the in-memory sessions for a web module are refreshed from the persistent store. As a result, the cache identifiers are continually increasing and the in-memory session attributes are overwritten by those of the persistent copy. Set this property to true if you want to prevent the cache identifiers from continually increasing. A value of true indicates that the session manager should assess whether the in-memory session for a web module is older than the copy in persistent store. If the configuration is a cluster, ensure that the system times of each cluster member are as identical as possible.

scheduleInvalidation

boolean

false

Enable this option to reduce the number of database updates required to keep the HTTP sessions alive. Specify the two hours of a day when there is the least activity in the application server. When this option is disabled, the invalidator process runs every few minutes to remove invalidated HTTP sessions.

scheduleInvalidationFirstHour

int

0

Indicates the first hour during which the invalidated sessions are cleared from the persistent store. Specify this value as an integer between 0 and 23. This value is valid only when schedule invalidation is enabled.

scheduleInvalidationSecondHour

int

0

Indicates the second hour during which the invalidated sessions are cleared from the persistent store. Specify this value as an integer between 0 and 23. This value is valid only when schedule invalidation is enabled.

useInvalidatedId

boolean

true

Set this property to "true" to reuse the incoming identifier if the session with that identifier was recently invalidated. This is a performance optimization because it prevents checking the persistent store.

DB2 Only

db2RowSize

  • 16KB

  • 32KB

  • 4KB

  • 8KB

4KB

Table space page size configured for the sessions table, if using a DB2 database. Increasing this value can improve database performance in some environments.
16KB
Use a table space page size of 16 KB. You must additionally create a DB2 buffer pool and table space, and specify 16KB as the page size for both. You must also specify the name of the table space you created.
32KB
Use a table space page size of 32 KB. You must additionally create a DB2 buffer pool and table space, and specify 32KB as the page size for both. You must also specify the name of the table space you created.
4KB
Use the default table space page size of 4 KB. You do not need to create a DB2 buffer pool or table space, and you do not need to specify a table space name.
8KB
Use a table space page size of 8 KB. You must additionally create a DB2 buffer pool and table space, and specify 8KB as the page size for both. You must also specify the name of the table space you created.

tableSpaceName

string

Table space to be used for the sessions table. This value is only required when the DB2 Row Size is greater than 4KB.

usingCustomSchemaName

boolean

false

Set this property to "true" if you are using DB2 for session persistence and the currentSchema property is set in the data source.

Oracle Only

rowSizeLimit

int

2

Set the limit of stored data per record, in megabytes. The default is 2 megabytes.

useOracleBlob

boolean

false

Set this property to "true" to create the database table using the Binary Large Object (BLOB) data type for the medium column. This value increases performance of persistent sessions when Oracle databases are used. Due to an Oracle restriction, BLOB support requires use of the Oracle Call Interface (OCI) database driver for more than 4000 bytes of data. You must also ensure that a new sessions table is created before the server is restarted by dropping your old sessions table or by changing the datasource definition to reference a database that does not contain a sessions table.

Performance

writeContents

  • ALL_SESSION_ATTRIBUTES

  • GET_AND_SET_ATTRIBUTES

  • ONLY_UPDATED_ATTRIBUTES

ONLY_UPDATED_ATTRIBUTES

Specifies how much session data should be written to the persistent store. By default, only updated attributes are written, but all attributes can be written instead (regardless of whether or not they changed).
ALL_SESSION_ATTRIBUTES
All attributes are written to the persistent store.
GET_AND_SET_ATTRIBUTES
Attributes for which getAttribute or setAttribute is invoked are written to the persistent store. This can be useful for applications that use getAttribute to obtain and mutate attribute values without using setAttribute to explicitly request that they be written to the persistent store.
ONLY_UPDATED_ATTRIBUTES
Only updated attributes are written to the persistent store.

writeFrequency

  • END_OF_SERVLET_SERVICE

  • MANUAL_UPDATE

  • TIME_BASED_WRITE

END_OF_SERVLET_SERVICE

Specifies when session data is written to the persistent store. By default, session data is written to the persistent store after the servlet completes execution. Changing this value can improve performance in some environments.
END_OF_SERVLET_SERVICE
Session data is written to the persistent store after the servlet completes execution.
MANUAL_UPDATE
A programmatic sync on the IBMSession object is required to write the session data to the persistent store.
TIME_BASED_WRITE
Session data is written to the persistent store based on the specified write interval value.

writeInterval

A period of time with second precision

2m

Number of seconds that should pass before writing session data to the persistent store. The default is 120 seconds. This value is only used when a time based write frequency is enabled. Specify a positive integer followed by a unit of time, which can be hours (h), minutes (m), or seconds (s). For example, specify 30 seconds as 30s. You can include multiple values in a single entry. For example, 1m30s is equivalent to 90 seconds.