user manual
Chapter 7: Clustering web components 73
Setting up your web container with JSS
Modifying a Borland web container for failover
In the Borland web container configuration file, server.xml, you need to add an
entry similar to the following code sample for each web application. For more
information about the server.xml file, go to Chapter 5, “Web server to web
container connectivity”.
<Manager className="org.apache.catalina.session.PersistentManager">
<Store className="org.apache.catalina.session.BorlandStore"
storeName="jss_factory"/>
</Manager>
The preceding code specifies the use of a PersistentManager with a storage
class BorlandStore. It also specifies the connection to a BorlandStore factory
named jss_factory. There must be a JSS with that factory name running in the
local network.
For a description of jss.factoryName, go to Chapter 6, “Java Session Service
(JSS) configuration”.
Session storage implementation
There are two methods of implementing session storage for your clustered
web components:
■
“Programmatic implementation” on page 73
■
“Automatic implementation” on page 73
Programmatic implementation
The Programmatic implementation assumes that each time you change the
session attributes, you call session.SetAttribute() to notify the Borland web
container that you have changed the session attributes.
This is a common operation in servlet development and when executed, there
is no need to modify the server.xml file. Each time you change the session
data, it is immediately written to the database through the JSS. Then if your
web container instance unexpectedly goes down, the next web container
instance designated to pick up the session accesses the session data. In
essence, the Programmatic implementation guarantees to save changes
immediately.
Automatic implementation
The Automatic implementation lets you store the session data periodically to
JSS, regardless of whether the data has changed. By using this
implementation, you do not need to notify the web container that the session
attribute has changed.
For example, you can change state without calling setAttribute () as depicted
in the following code example:










