Index: tomcat/src/main/org/jboss/web/tomcat/service/session/SessionBasedClusteredSession.java =================================================================== --- tomcat/src/main/org/jboss/web/tomcat/service/session/SessionBasedClusteredSession.java (revision 89288) +++ tomcat/src/main/org/jboss/web/tomcat/service/session/SessionBasedClusteredSession.java (working copy) @@ -146,7 +146,7 @@ */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { - synchronized (this) + synchronized (getSession()) { // Let superclass read in everything but the attribute map super.readExternal(in); @@ -164,7 +164,7 @@ */ public void writeExternal(ObjectOutput out) throws IOException { - synchronized (this) + synchronized (getSession()) { // Let superclass write out everything but the attribute map super.writeExternal(out); Index: tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheClusteredSession.java =================================================================== --- tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheClusteredSession.java (revision 89288) +++ tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheClusteredSession.java (working copy) @@ -113,21 +113,24 @@ /** * Increment our version and place ourself in the cache. */ - public synchronized void processSessionRepl() + public void processSessionRepl() { - // Replicate the session. - if (log.isTraceEnabled()) + synchronized (getSession()) { - log.trace("processSessionRepl(): session is dirty. Will increment " + + // Replicate the session. + if (log.isTraceEnabled()) + { + log.trace("processSessionRepl(): session is dirty. Will increment " + "version from: " + getVersion() + " and replicate."); - } - this.incrementVersion(); - proxy_.putSession(realId, this); + } + this.incrementVersion(); + proxy_.putSession(realId, this); - sessionAttributesDirty = false; - sessionMetadataDirty = false; + sessionAttributesDirty = false; + sessionMetadataDirty = false; - updateLastReplicated(); + updateLastReplicated(); + } } /** Index: tomcat/src/main/org/jboss/web/tomcat/service/session/ClusteredSession.java =================================================================== --- tomcat/src/main/org/jboss/web/tomcat/service/session/ClusteredSession.java (revision 89288) +++ tomcat/src/main/org/jboss/web/tomcat/service/session/ClusteredSession.java (working copy) @@ -815,7 +815,7 @@ if (expiring) return; - synchronized (this) + synchronized (getSession()) { // If we had a race to this sync block, another thread may // have already completed expiration. If so, don't do it again @@ -1212,7 +1212,7 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { - synchronized (this) + synchronized (getSession()) { // From StandardSession id = in.readUTF(); @@ -1284,7 +1284,7 @@ public void writeExternal(ObjectOutput out) throws IOException { - synchronized (this) + synchronized (getSession()) { // From StandardSession out.writeUTF(id);