Corrected the use of the ACTIVITY_CHECK flag
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 9 Oct 2006 18:28:21 +0000 (18:28 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 9 Oct 2006 18:28:21 +0000 (18:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@454450 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/ha/session/DeltaSession.java

index 8f5d7df..27c60a9 100644 (file)
@@ -104,7 +104,6 @@ public class DeltaSession extends StandardSession implements Externalizable,Clus
 
     public DeltaSession(Manager manager) {
         super(manager);
-        accessCount = new AtomicInteger();
         this.resetDeltaRequest();
     }
 
@@ -316,7 +315,7 @@ public class DeltaSession extends StandardSession implements Externalizable,Clus
         if (!this.isValid) {
             return false;
         }
-        if (accessCount.get() > 0) {
+        if (ACTIVITY_CHECK && accessCount.get() > 0) {
             return true;
         }
         if (maxInactiveInterval >= 0) {
@@ -547,7 +546,6 @@ public class DeltaSession extends StandardSession implements Externalizable,Clus
         isValid = ( (Boolean) stream.readObject()).booleanValue();
         thisAccessedTime = ( (Long) stream.readObject()).longValue();
         version = ( (Long) stream.readObject()).longValue();
-        this.accessCount = new AtomicInteger();
         boolean hasPrincipal = stream.readBoolean();
         principal = null;
         if (hasPrincipal) {
@@ -579,6 +577,7 @@ public class DeltaSession extends StandardSession implements Externalizable,Clus
         if (notes == null) {
             notes = new Hashtable();
         }
+        activate();
     }
 
     public synchronized void writeExternal(ObjectOutput out ) throws java.io.IOException {
@@ -608,7 +607,6 @@ public class DeltaSession extends StandardSession implements Externalizable,Clus
      *                if an input/output error occurs
      */
     private void writeObject(ObjectOutput stream) throws IOException {
-
         // Write the scalar instance variables (except Manager)
         stream.writeObject(new Long(creationTime));
         stream.writeObject(new Long(lastAccessedTime));