jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1504389 - in /jackrabbit/oak/trunk/oak-jcr/src: main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Date Thu, 18 Jul 2013 08:32:13 GMT
Author: thomasm
Date: Thu Jul 18 08:32:12 2013
New Revision: 1504389

URL: http://svn.apache.org/r1504389
Log:
OAK-803 Backwards compatibility of long-lived sessions
make admin sessions refresh on every access (temporarily disable the changed behavior)

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java?rev=1504389&r1=1504388&r2=1504389&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
Thu Jul 18 08:32:12 2013
@@ -136,7 +136,7 @@ public class RepositoryImpl implements R
             // be on the latest revision: set refresh interval to 0. See OAK-803.
             SessionContext context = new SessionContext(
                     this, whiteboard, new SessionDelegate(
-                            contentSession, isAdmin(contentSession) ? 0 : AUTO_REFRESH_INTERVAL));
+                            contentSession, /* isAdmin(contentSession) ? 0 : */ AUTO_REFRESH_INTERVAL));
             return context.getSession();
         } catch (LoginException e) {
             throw new javax.jcr.LoginException(e.getMessage(), e);

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java?rev=1504389&r1=1504388&r2=1504389&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Thu Jul 18 08:32:12 2013
@@ -1339,7 +1339,15 @@ public class RepositoryTest extends Abst
 
             session1.save();
 
-            // Make sure these items are still accessible through another session
+            // Make sure they are still not accessible through another session
+            assertFalse(session2.itemExists("/node1"));
+            assertFalse(session2.itemExists("/node1/node2"));
+            assertFalse(session2.itemExists("/node1/node3"));
+            assertFalse(session2.itemExists("/node1/node3/property1"));
+
+            session2.refresh(false);
+
+            // Make sure they are accessible through another session after refresh
             assertTrue(session2.itemExists("/node1"));
             assertTrue(session2.itemExists("/node1/node2"));
             assertTrue(session2.itemExists("/node1/node3"));
@@ -1442,8 +1450,8 @@ public class RepositoryTest extends Abst
             session1.save();
             session2.save();
             assertTrue(session1.getRootNode().hasNode("node1"));
-            assertTrue(session1.getRootNode().hasNode("node2"));
-            assertTrue(session2.getRootNode().hasNode("node1"));
+            assertFalse(session1.getRootNode().hasNode("node2")); // was not visible during
save
+            assertTrue(session2.getRootNode().hasNode("node1")); // save refreshes
             assertTrue(session2.getRootNode().hasNode("node2"));
         } finally {
             session1.logout();
@@ -1496,7 +1504,7 @@ public class RepositoryTest extends Abst
 
             session1.save();
             assertFalse(session1.getRootNode().hasNode("node"));
-            assertFalse(session2.getRootNode().hasNode("node"));
+            assertTrue(session2.getRootNode().hasNode("node"));
 
             try {
                 session2.save();



Mime
View raw message