jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r704358 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
Date Tue, 14 Oct 2008 07:40:51 GMT
Author: angela
Date: Tue Oct 14 00:40:50 2008
New Revision: 704358

URL: http://svn.apache.org/viewvc?rev=704358&view=rev
Log:
JCR-1800 lockmgr isn't aware about external unlock (CacheBehavior.OBSERVATION)

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java?rev=704358&r1=704357&r2=704358&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
Tue Oct 14 00:40:50 2008
@@ -20,34 +20,33 @@
 import org.apache.jackrabbit.jcr2spi.SessionListener;
 import org.apache.jackrabbit.jcr2spi.WorkspaceManager;
 import org.apache.jackrabbit.jcr2spi.config.CacheBehaviour;
-import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry;
-import org.apache.jackrabbit.jcr2spi.operation.Operation;
+import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.jcr2spi.operation.LockOperation;
-import org.apache.jackrabbit.jcr2spi.operation.LockRelease;
 import org.apache.jackrabbit.jcr2spi.operation.LockRefresh;
-import org.apache.jackrabbit.jcr2spi.state.NodeState;
-import org.apache.jackrabbit.jcr2spi.state.Status;
-import org.apache.jackrabbit.jcr2spi.state.ItemStateLifeCycleListener;
+import org.apache.jackrabbit.jcr2spi.operation.LockRelease;
+import org.apache.jackrabbit.jcr2spi.operation.Operation;
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
+import org.apache.jackrabbit.jcr2spi.state.ItemStateLifeCycleListener;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
+import org.apache.jackrabbit.jcr2spi.state.Status;
 import org.apache.jackrabbit.spi.LockInfo;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
-import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-import javax.jcr.lock.Lock;
-import javax.jcr.lock.LockException;
-import javax.jcr.RepositoryException;
-import javax.jcr.Node;
 import javax.jcr.Item;
-import javax.jcr.Session;
 import javax.jcr.ItemNotFoundException;
-
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.lock.Lock;
+import javax.jcr.lock.LockException;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.HashMap;
 
 /**
  * <code>LockManagerImpl</code>...
@@ -307,7 +306,7 @@
             // error occured.
             // for this case, assume that no lock exists and delegate final
             // validation to the spi-implementation.
-            log.warn("Error while accessing lock holding NodeState", e);
+            log.warn("Error while accessing lock holding NodeState", e.getMessage());
             return null;
         }
     }
@@ -546,10 +545,14 @@
             // status changes of the jcr:lockIsDeep property.
             if (cacheBehaviour == CacheBehaviour.OBSERVATION) {
                 try {
+                    if (!lockHoldingState.hasPropertyName(NameConstants.JCR_LOCKISDEEP))
{
+                        // force reloading of the lock holding node.
+                        itemManager.getItem(lockHoldingState.getNodeEntry().getPath());
+                    }
                     PropertyState ps = lockHoldingState.getPropertyState(NameConstants.JCR_LOCKISDEEP);
                     ps.addListener(this);
                 } catch (RepositoryException e) {
-                    log.warn("Internal error", e);
+                    log.warn("Unable to retrieve jcr:isDeep property after lock creation.",
e.getMessage());
                 }
             }
         }
@@ -564,7 +567,7 @@
                         ps.removeListener(this);
                     }
                 } catch (ItemNotFoundException e) {
-                    log.debug("jcr:isDeep doesn't exist any more.");
+                    log.debug("jcr:lockIsDeep doesn't exist any more.");
                 } catch (Exception e) {
                     log.warn(e.getMessage());
                 }



Mime
View raw message