user manual

72 BES Developers Guide
Smart session handling
When there is no session involved, the IIOP connector can do indiscriminate
round robining. However, when sessions are involved, it is important that
Apache routes its session requests to the web container that initiated the
session.
In other http-to-servlet redirectors (and in the earlier version of the IIOP
connector) this is achieved by maintaining a list of sessions-ids-to-web-
container-id's in the web server's cache. This presents numerous issues with
maintaining the state of this list. This list can be very large and wasteful of
system resources. It can become out of date, for example, sessions can
timeout and, in general, is an inefficient and problematic facet of the web
server to web container redirection paradigm.
The IIOP connector resolves this by utilizing a technique called "smart session
ids". This is where the IOR of the web container is embedded within the
session id returned by the web container as part of the session cookie (or URL
in the case of url-rewriting).
When the web container generates the session ID, it first determines if the
request originated from the IIOP connector. If so, it obtains the stringified IOR
of the IIOP connector through which the request is received. The web
container generates the normal session ID as it always generates, but pre-
fixes the stringified IOR in front of it. For example:
Stringified IOR: IOR:xyz
Normal session ID: abc
The new session ID: xyz_abc
In the case where the original web container has stopped running, failover is
employed to locate another instance of an equivalent web container.
In the case of corbaloc identified web containers, where automatic osagent
failover is not guaranteed, the IIOP connector performs a manual "rebind" to
obtain a valid reference to the running equivalent web container.
Obviously, if there are no other running instances of the web container, then
the http request fails.
The new web container obtains the old state from the session database and
continues to service the request. When returning the response the new web
container changes the session ID to reflect its IOR. This should be transparent
to Apache as it does not look at the session ID on the way back to the browser
client.
Setting up your web container with JSS
To properly failover when sessions are involved, you must set up the web
containers with the same JSS backend.