Example: Configuring for serialization session access using wsadmin
The following example configures session management of a Web container for serialization session access.
- Idenitfy the appserver and assign it to the server variable:
Using Jacl:
set server [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
Using Jython:
server = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/') print server
Example output:
server1(cells/mycell/nodes/mynode/servers/server1:server.xml#Server_1)
- Identify the session management belonging to the server and assign it to the smgr variable:
Using Jacl:
set smgr [$AdminConfig list SessionManager $server]
Using Jython:
smgr = AdminConfig.list('SessionManager', server) print smgr
Example output:
(cells/mycell/nodes/mynode/servers/server1:server.xml#SessionManager_1)
- Enable serialization session access.
- The following example sets the maximum wait time a servlet waits on a session before continuing processing:
Using Jacl:
$AdminConfig modify $smgr {{allowSerializedSessionAccess true} {maxWaitTime 20}}
Using Jython:
AdminConfig.modify(smgr, [['allowSerializedSessionAccess', 'true'], ['maxWaitTime', 20]])
- In the following example, servlet processing can stop when the session request times out:
Using Jacl:
$AdminConfig modify $smgr {{allowSerializedSessionAccess true} {maxWaitTime 20} {accessSessionOnTimeout true}}
Using Jython:
AdminConfig.modify(smgr, [['allowSerializedSessionAccess', 'true'], ['maxWaitTime', 20], ['accessSessionOnTimeout', 'true']])
- Save the changes with the following command:
Using Jacl:
$AdminConfig save
Using Jython:
AdminConfig.save()