jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From un...@apache.org
Subject svn commit: r1390916 - /jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
Date Thu, 27 Sep 2012 10:01:13 GMT
Author: unico
Date: Thu Sep 27 10:01:12 2012
New Revision: 1390916

URL: http://svn.apache.org/viewvc?rev=1390916&view=rev
Log:
JCR-3399 Backport: Shared ISM does not release the internal Writelock if something unexpectedly
is happening in externalUpdate

Modified:
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java?rev=1390916&r1=1390915&r2=1390916&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
Thu Sep 27 10:01:12 2012
@@ -1513,18 +1513,18 @@ public class SharedItemStateManager
         boolean holdingWriteLock = false;
 
         ISMLocking.WriteLock wLock = null;
-        try {
-            wLock = acquireWriteLock(external);
-            holdingWriteLock = true;
-
-            doExternalUpdate(external);
-        } catch (ItemStateException e) {
-            String msg = "Unable to acquire write lock.";
-            log.error(msg);
-        }
-
         ISMLocking.ReadLock rLock = null;
         try {
+	        try {
+	            wLock = acquireWriteLock(external);
+	            holdingWriteLock = true;
+	
+	            doExternalUpdate(external);
+	        } catch (ItemStateException e) {
+	            String msg = "Unable to acquire write lock.";
+	            log.error(msg);
+	        }
+
             if (wLock != null) {
                 rLock = wLock.downgrade();
                 holdingWriteLock = false;



Mime
View raw message