Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 76612 invoked from network); 14 Oct 2008 07:41:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Oct 2008 07:41:47 -0000 Received: (qmail 16087 invoked by uid 500); 14 Oct 2008 07:41:43 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 16061 invoked by uid 500); 14 Oct 2008 07:41:43 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 16010 invoked by uid 99); 14 Oct 2008 07:41:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Oct 2008 00:41:43 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Oct 2008 07:40:44 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 60D09238889E; Tue, 14 Oct 2008 00:40:51 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@jackrabbit.apache.org From: angela@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081014074051.60D09238889E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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; /** * LockManagerImpl... @@ -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()); }