httpSessionDatabase - HTTP Session Database (httpSessionDatabase)

Controls how HTTP sessions are persisted to a database.

NameTypeDefaultDescription
dataSourceRefstringThe identifier of the data source the session manager should use to persist HTTP session data.
tableNamestringsessionsThe database table name.
useMultiRowSchemabooleanfalseWhen 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.
skipIndexCreationbooleanfalseSet 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.
writeFrequency
  • MANUAL_UPDATE
  • TIME_BASED_WRITE
  • END_OF_SERVLET_SERVICE
END_OF_SERVLET_SERVICESpecifies 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.
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.
END_OF_SERVLET_SERVICE
Session data is written to the persistent store after the servlet completes execution.
writeIntervalA period of time with second precision2mNumber 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.
writeContents
  • ONLY_UPDATED_ATTRIBUTES
  • ALL_SESSION_ATTRIBUTES
ONLY_UPDATED_ATTRIBUTESSpecifies 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).
ONLY_UPDATED_ATTRIBUTES
Only updated attributes are written to the persistent store.
ALL_SESSION_ATTRIBUTES
All attributes are written to the persistent store.
scheduleInvalidationbooleanfalseEnable 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.
scheduleInvalidationFirstHourint0Indicates 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.
scheduleInvalidationSecondHourint0Indicates 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.
noAffinitySwitchBackbooleanfalseSet 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.
useInvalidatedIdbooleantrueSet 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.
onlyCheckInCacheDuringPreInvokebooleanfalseA 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.
optimizeCacheIdIncrementsbooleantrueIf 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.
db2RowSize
  • 32KB
  • 4KB
  • 16KB
  • 8KB
4KBTable space page size configured for the sessions table, if using a DB2 database. Increasing this value can improve database performance in some environments.
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.
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.
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.
tableSpaceNamestringTable space to be used for the sessions table. This value is only required when the DB2 Row Size is greater than 4KB.
usingCustomSchemaNamebooleanfalseSet this property to "true" if you are using DB2 for session persistence and the currentSchema property is set in the data source.
useOracleBlobbooleanfalseSet 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.