Chapter 5. Tuning WebSphere Application Server 107
The benefits of using persistent sessions are:
To keep session information from disappearing in case of a failure of the
application server node.
To share this information between different application server instances.
To reduce the quantity of information loaded in memory when you store very
large objects in your sessions.
You need to enable persistent session management in case that you want to
establish workload management among multiple WCS clones. You can get more
information on the procedure required to create clones in Chapter 4 of
WebSphere Scalability: WLM and Clustering using WebSphere Application
To activate persistent session management in WAS, you first need to create a
database that will hold all the session information. Log on as your db2
administrator ID, then enter the following command on your database server:
db2 create db <name_of_db>
where you will replace <name_of_db> with the name you want to give to this
database. For our tests, we simply called it “session”. If the database is on a
remote machine, you need to create a database alias on the WAS machine.
Create a new DataSource in WebSphere, referencing the new table. To do that,
right-click on WebSphere Administrative Domain, and then select Create ->
DataSource. Give a name to the DataSource. We called our new DataSource
“WCS Sessions DB2 Datasource session”. In case that the database is on a
remote machine, you need to provide database user id and its password. Enter
the name of your database, which was named as “session” in our case. Next
select the correct driver for your database.
Once your DataSource is created, you can activate the persistence sessions in
WebSphere Application Server. Expand WebSphere Administrative Domain ->
node name -> WebSphere Commerce Server -> WCS Web Container ->
Select the Enable tab, as shown on Figure 5-17 on page 108, and then set
Enable Persistent Sessions to Yes.