Is there a useDirtyFlag option for Tomcat 6 cluster configuration?

Posted by kevinjansz on Stack Overflow See other posts from Stack Overflow or by kevinjansz
Published on 2010-04-21T07:13:50Z Indexed on 2010/05/05 2:08 UTC
Read the original article Hit count: 273

Filed under:
|
|
|
|

In Tomcat 5.0.x you had the ability to set useDirtyFlag="false" to force replication of the session after every request rather than checking for set/removeAttribute calls.

<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                 managerClassName="org.apache.catalina.cluster.session.SimpleTcpReplicationManager"
                 expireSessionsOnShutdown="false"
                 **useDirtyFlag="false"**
                 doClusterLog="true"
                 clusterLogName="clusterLog"> ...

The comments in the server.xml stated this may be used to make the following work:

<%
    HashMap map = (HashMap)session.getAttribute("map");
    map.put("key","value");
%>

i.e. change the state of an object that has already been put in the session and you can be sure that this object still be replicated to the other nodes in the cluster.

According to the Tomcat 6 documentation you only have two "Manager" options - DeltaManager & BackupManager ... neither of these seem to allow this option or anything like it. In my testing the default setup:

  <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>

where you get the DeltaManager by default, it's definitely behaving as useDirtyFlag="true" (as I'd expect).

So my question is - is there an equivalent in Tomcat 6?

Looking at the source I can see a manager implementation "org.apache.catalina.ha.session.SimpleTcpReplicationManager" which does have the useDirtyFlag but the javadoc comments in this state it's "Tomcat Session Replication for Tomcat 4.0" ... I don't know if this is ok to use - I'm guessing not as it's not mentioned in the main cluster configuration documentation.

© Stack Overflow or respective owner

Related posts about java

Related posts about tomcat6