Configure for database session persistence using wsadmin
The following example configures the session management of a Web container for database session persistence.
Before performing this task you have to create a JDBC provider and create a data source that points to an existing database.
Using Jacl...
### Identify the appserver and assign it to the server variable... set server [$AdminConfig getid /Cell:cell/Node:node/Server:server/] ### Identify the session management belonging to the server and assign it ### to the smgr variable... set smgr [$AdminConfig list SessionManager $server] ### Modify database session persistence... $AdminConfig modify $smgr { \ {sessionDatabasePersistence {{datasourceJNDIName jdbc/mySession} \ {userId myUser} \ {password myPassword}}}} $AdminConfig save
Using Jython
server = AdminConfig.getid('/Cell:cell/Node:node/Server:server/') print server smgr = AdminConfig.list('SessionManager', server) print smgr AdminConfig.modify(smgr, [['sessionDatabasePersistence', [['datasourceJNDIName', 'jdbc/mySession'], ['userId', 'myUser'], ['password', 'myPassword']]]]) AdminConfig.save()