Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 11579 invoked from network); 3 Mar 2009 15:01:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Mar 2009 15:01:18 -0000 Received: (qmail 82277 invoked by uid 500); 3 Mar 2009 15:01:18 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 81881 invoked by uid 500); 3 Mar 2009 15:01:17 -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 81872 invoked by uid 99); 3 Mar 2009 15:01:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2009 07:01:17 -0800 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; Tue, 03 Mar 2009 15:01:16 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 92882234C4B2 for ; Tue, 3 Mar 2009 07:00:56 -0800 (PST) Message-ID: <1277502112.1236092456599.JavaMail.jira@brutus> Date: Tue, 3 Mar 2009 07:00:56 -0800 (PST) From: =?utf-8?Q?Claus_K=C3=B6ll_=28JIRA=29?= To: dev@jackrabbit.apache.org Subject: [jira] Commented: (JCR-1633) When node is created and locked in same transaction, exception is thrown In-Reply-To: <1262400537.1212161805981.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-1633?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D126783= 37#action_12678337 ]=20 Claus K=C3=B6ll commented on JCR-1633: --------------------------------- As Alexander wrote i give him partly right. I understand the specification= in that way that you can not lock a node till it has pending changes. In the context of a transaction it is a little bit difference. I see the Tr= ansaction as a atomic operation so you should be able to lock a node after = create and save in one transaction although the persistence moves to the commit of the transaction. I will provide a patch that handles this behaviour with some more tescases = so we can see if it works as described in the specification. > When node is created and locked in same transaction, exception is thrown > ------------------------------------------------------------------------ > > Key: JCR-1633 > URL: https://issues.apache.org/jira/browse/JCR-1633 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-core, locks, transactions > Affects Versions: core 1.4.3, core 1.4.4 > Environment: Jackrabbit Core 1.4.4, Jencks 2.0, Springmodules 0.8= a, Jackrabbit JCA 1.4 > Reporter: Roman Puchkovskiy > Attachments: test-create-and-lock-in-same-tx.zip, XALockTest.java > > > Following code fails when executed inside an XA transaction: > Node n =3D session.getRootNode().addNode("n"); > n.addMixin("mix:lockable"); > session.save(); > Lock lock =3D n.lock(false, false); > Stacktrace is > Caused by: javax.transaction.xa.XAException > =09at org.apache.jackrabbit.core.TransactionContext.prepare(TransactionCo= ntext.java:155) > =09at org.apache.jackrabbit.core.XASessionImpl.commit(XASessionImpl.java:= 337) > =09at org.apache.jackrabbit.jca.TransactionBoundXAResource.commit(Transac= tionBoundXAResource.java:39) > =09at org.apache.geronimo.transaction.manager.WrapperNamedXAResource.comm= it(WrapperNamedXAResource.java:47) > =09at org.apache.geronimo.transaction.manager.TransactionImpl.commit(Tran= sactionImpl.java:301) > =09... 32 more > Caused by: org.apache.jackrabbit.core.TransactionException: Unable to upd= ate. > =09at org.apache.jackrabbit.core.lock.XAEnvironment.prepare(XAEnvironment= .java:275) > =09at org.apache.jackrabbit.core.lock.XALockManager.prepare(XALockManager= .java:245) > =09at org.apache.jackrabbit.core.TransactionContext.prepare(TransactionCo= ntext.java:138) > =09... 36 more > Caused by: javax.jcr.ItemNotFoundException: failed to build path of 48fb5= 9d8-ac77-4b9f-8b53-9f2492dca5e5: 48fb59d8-ac77-4b9f-8b53-9f2492dca5e5: 48fb= 59d8-ac77-4b9f-8b53-9f2492dca5e5 > =09at org.apache.jackrabbit.core.HierarchyManagerImpl.getPath(HierarchyMa= nagerImpl.java:407) > =09at org.apache.jackrabbit.core.CachingHierarchyManager.getPath(CachingH= ierarchyManager.java:272) > =09at org.apache.jackrabbit.core.lock.LockManagerImpl.getPath(LockManager= Impl.java:651) > =09at org.apache.jackrabbit.core.lock.LockManagerImpl.internalLock(LockMa= nagerImpl.java:276) > =09at org.apache.jackrabbit.core.lock.XAEnvironment$LockInfo.update(XAEnv= ironment.java:409) > =09at org.apache.jackrabbit.core.lock.XAEnvironment.prepare(XAEnvironment= .java:273) > =09... 38 more > Caused by: org.apache.jackrabbit.core.state.NoSuchItemStateException: 48f= b59d8-ac77-4b9f-8b53-9f2492dca5e5 > =09at org.apache.jackrabbit.core.state.SessionItemStateManager.getItemSta= te(SessionItemStateManager.java:189) > =09at org.apache.jackrabbit.core.HierarchyManagerImpl.getItemState(Hierar= chyManagerImpl.java:188) > =09at org.apache.jackrabbit.core.HierarchyManagerImpl.getPath(HierarchyMa= nagerImpl.java:402) > =09... 43 more --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.