Friday, May 14, 2004
How to use DB2 7 as the session data source for WebSphere 4
Work related. I never did find a single document that spelled all this out in one simple sequence of steps. So here goes.
- Install DB2 if it is not already installed.
- On the database server, create a database to use for the session data. I assume you need one database for each server group, I haven't tried doing it any other way.
- Install the DB2 Admin Client on the app server box box. (Skip this step if this is the same machine where you installed the DB2 database)
- Run Start->Programs->IBM DB2->Client Configuration Assistant on the app server.
- Choose "add".
- Choose "Manually configure a connection to a database".
- Protocol: TCP/IP
- Hostname: (whatever DB server is being used)
- Port: 50000
- Database and database alias: (whatever name you created)
- Take the defaults for everything else .
- Test the connection.
- Assuming that the binaries for the admin client installed in c:\program files\sqllib, go into c:\program files\sqllib\java12 and execute these commands in this order. This is absolutely neccessary in order for WebSphere to be able to use the db2 libraries.
- In websphere, set up a JDBC provider for DB2. The jar file for the classpath is c:\program files\sqllib\java\db2jdbc.zip. Note that is a ZIP file, not a JAR.
- Configure a datasource under this provider. In single-server edition, there are places to enter the "databaseName". Use the same one that you've used in all the other steps. In advanced, you have to add this as a custom property.
- In the properties of the server group, go to "Services" tab. Highlight the "Session Manager Service" and hit "Edit Properties".
- On the "Persistence" tab, check "enable persistent sessions".
- Choose the "Low (optimize for session failover)" performance option.
- On the database tab, configure the same datasource you set up in step 16.
- If you get errors about "unsatisfied link" or something about DLL files not being in JAVA_LIBARARY_PATH, try restarting the admin server or as a last resort the physical machine.