Search code examples
javasessionjakarta-eetomcatwebsphere

Some questions about Websphere session management stratagy and session related content in Servlet 2.3 specification


In documentation Websphere Application Server Information Center - Clustered session support, it says

The session management facility requires an affinity mechanism so that all requests for a particular session are directed to the same application server instance in the cluster. This requirement conforms to the Servlet 2.3 specification in that multiple requests for a session cannot coexist in multiple application servers.

Does it mean Websphere can only support sticky session(session affinity) mechanism? If not, how to config on Websphere to support non-sticky session stratage?

And In Servlet 2.3 specification, SRV.7.7.2 Distributed Environments

Within an application marked as distributable, all requests that are part of a session must handled by one virtual machine at a time.

Based on this specification, it supposes that we should follow this rule, but we can use non-sticky session stratage on Apache + Tomcat cluster, doesn't it break the rule?

Any response is appreciated.


Solution

  • Concerning your second question: If you use Tomcat behind an Apache server, you're using a component (The Apache server) that is not JEE compliant, thus it doesn't have to follow any JEE rules.

    Concerning your first question, with Websphere you can choose between using the proxy server, the HTTP plugin, and implementing your own proxy solution:

    http://pic.dhe.ibm.com/infocenter/clmhelp/v4r0m3/index.jsp?re=1&topic=/com.ibm.jazz.install.doc/topics/t_config_reverse_proxy_ihs.html&scope=null

    http://www.ibm.com/developerworks/websphere/techjournal/1010_pape/1010_pape.html

    You can ignore session affinity by means of the CloneiD property on the plugin-cfg.xml file

    http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/rwsv_plugincfg.html

    CloneID (zero or one attribute for each Server) If this unique ID is present in the HTTP cookie header of a request (or the URL if using URL rewriting), the plug-in routes the request to this particular server, provided all other routing rules are met. If a CloneID is not specified in the Server, then session affinity is not enabled for this server.