jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r587882 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
Date Wed, 24 Oct 2007 12:52:17 GMT
Author: angela
Date: Wed Oct 24 05:52:16 2007
New Revision: 587882

URL: http://svn.apache.org/viewvc?rev=587882&view=rev
Log:
JCR-1108 JCR2SPI: error level logging when cleaning up session locks

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=587882&r1=587881&r2=587882&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
Wed Oct 24 05:52:16 2007
@@ -251,7 +251,7 @@
                 try {
                     unlock(nState);
                 } catch (RepositoryException e) {
-                    log.error("Error while unlocking session scoped lock. Cleaning up local
lock status.");
+                    log.warn("Error while unlocking session scoped lock. Cleaning up local
lock status.");
                     // at least clean up local lock map and the locks life cycle
                     l.lockState.unlocked();
                 }
@@ -538,6 +538,12 @@
         }
 
         private void startListening() {
+            // LockState must be aware of removal of the Node.
+            lockHoldingState.addListener(this);
+
+            // in case of CacheBehaviour.OBSERVATION this lockstate can also
+            // be aware of another session removing the lock -> listen to
+            // status changes of the jcr:lockIsDeep property.
             if (cacheBehaviour == CacheBehaviour.OBSERVATION) {
                 try {
                     PropertyState ps = lockHoldingState.getPropertyState(NameConstants.JCR_LOCKISDEEP);
@@ -549,6 +555,8 @@
         }
 
         private void stopListening() {
+            lockHoldingState.removeListener(this);
+
             if (cacheBehaviour == CacheBehaviour.OBSERVATION) {
                 try {
                     if (lockHoldingState.hasPropertyName(NameConstants.JCR_LOCKISDEEP)) {
@@ -615,6 +623,7 @@
                 lockState.startListening();
             } else if (isHoldBySession()) {
                 lockMap.put(lockState.lockHoldingState, this);
+                lockState.startListening();
                 // open-scoped locks: the map entry and the lock information
                 // stored therein may become outdated if the token is transfered
                 // to another session -> info must be reloaded.



Mime
View raw message