Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 26792 invoked from network); 16 Sep 2009 07:08:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Sep 2009 07:08:24 -0000 Received: (qmail 62217 invoked by uid 500); 16 Sep 2009 07:08:23 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 62129 invoked by uid 500); 16 Sep 2009 07:08:23 -0000 Mailing-List: contact dev-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 dev@jackrabbit.apache.org Received: (qmail 62112 invoked by uid 99); 16 Sep 2009 07:08:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Sep 2009 07:08:23 +0000 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Sep 2009 07:08:18 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 879BE234C044 for ; Wed, 16 Sep 2009 00:07:57 -0700 (PDT) Message-ID: <211142468.1253084877545.JavaMail.jira@brutus> Date: Wed, 16 Sep 2009 00:07:57 -0700 (PDT) From: "angela (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Commented: (JCR-2273) Lock.getLockToken() returns null for session scoped lock In-Reply-To: <608979228.1250895494968.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-2273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12755913#action_12755913 ] angela commented on JCR-2273: ----------------------------- what about Lock#isLockOwningSession from the javadoc: /** * Returns true if the current session is the owner of this * lock, either because it is session-scoped and bound to this session or * open-scoped and this session currently holds the token for this lock. * Returns false otherwise. * * @return a boolean. * @since JCR 2.0 */ public boolean isLockOwningSession(); > Lock.getLockToken() returns null for session scoped lock > -------------------------------------------------------- > > Key: JCR-2273 > URL: https://issues.apache.org/jira/browse/JCR-2273 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-core > Affects Versions: 1.6.0 > Environment: Linux (Fedora 11), Sun JDK 1.5 (Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02)) > Reporter: Marvin Lau > > The following code (part of a JUnit test) works in Jackrabbit 1.5.0 but fails in Jackrabbit 1.6.0 at the last line (assertNotNull("Failed to get lock token.", sessionLockToken)). Is this related to the work on JSR 283 where the behavior of Lock.getLockToken() has changed? > // Create lockable node > Node rootNode = session.getRootNode(); > Node lockableNode = rootNode.addNode("foo"); > rootNode.save(); > lockableNode.addMixin(JcrConstants.MIX_LOCKABLE); > lockableNode.save(); > session.save(); > // Get an open scope lock on the node > lockableNode.lock(false, false); > // Get lock token > Lock lock = lockableNode.getLock(); > String openLockToken = lock.getLockToken(); > assertNotNull("Failed to get lock token.", openLockToken); > // Remove the lock token by unlocking > lockableNode.unlock(); > // Get a session scope lock on the node > lockableNode.lock(false, true); > // Get lock token > lock = lockableNode.getLock(); > String sessionLockToken = lock.getLockToken(); > assertNotNull("Failed to get lock token.", sessionLockToken); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.