tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r405105 - /tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/DeltaSession.java
Date Mon, 08 May 2006 17:49:59 GMT
Author: fhanik
Date: Mon May  8 10:49:58 2006
New Revision: 405105

URL: http://svn.apache.org/viewcvs?rev=405105&view=rev
Log:
lock the session when setting the principal
locks are used so that replicated diffs can't be modified on the fly

Modified:
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/DeltaSession.java

Modified: tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/DeltaSession.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/DeltaSession.java?rev=405105&r1=405104&r2=405105&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/DeltaSession.java
(original)
+++ tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/DeltaSession.java
Mon May  8 10:49:58 2006
@@ -272,9 +272,14 @@
     }
 
     public void setPrincipal(Principal principal, boolean addDeltaRequest) {
-        super.setPrincipal(principal);
-        if (addDeltaRequest && (deltaRequest != null))
-            deltaRequest.setPrincipal(principal);
+        try { 
+            lock();
+            super.setPrincipal(principal);
+            if (addDeltaRequest && (deltaRequest != null))
+                deltaRequest.setPrincipal(principal);
+        } finally {
+            unlock();
+        }
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message