Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 89873 invoked from network); 31 Mar 2009 13:36:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Mar 2009 13:36:17 -0000 Received: (qmail 74731 invoked by uid 500); 31 Mar 2009 13:36:16 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 74669 invoked by uid 500); 31 Mar 2009 13:36:16 -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 74652 invoked by uid 99); 31 Mar 2009 13:36:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Mar 2009 13:36:11 +0000 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [194.8.61.7] (HELO spamslammer1.tirol.gv.at) (194.8.61.7) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Mar 2009 13:36:05 +0000 Received: from mailscan1.tirol.local (unknown [10.10.128.204]) by spamslammer1.tirol.gv.at (BorderWare Security Platform) with ESMTP id 111EE180C5B47DFF for ; Tue, 31 Mar 2009 15:35:39 +0200 (CEST) Received: from mxs0.tirol.local (unverified) by mailscan1.tirol.local (Clearswift SMTPRS 5.3.2) with ESMTP id for ; Tue, 31 Mar 2009 15:35:13 +0200 Received: from mxs01.tirol.local ([10.10.128.211]) by mxs0.tirol.local with Microsoft SMTPSVC(6.0.3790.1830); Tue, 31 Mar 2009 15:35:12 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: LockProblem in XA Environment Date: Tue, 31 Mar 2009 15:35:12 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: LockProblem in XA Environment Thread-Index: AcmyBYREGcKmPN/jT3Clbf2yHZkEfQ== From: =?iso-8859-1?Q?K=D6LL_Claus?= To: X-OriginalArrivalTime: 31 Mar 2009 13:35:12.0529 (UTC) FILETIME=[848EA010:01C9B205] X-Virus-Checked: Checked by ClamAV on apache.org Hi @ all, i have a Problem with Lock/Unlock a Node in a XA Environment The Test Case : -------------------------------------------------------------- UserTransaction utx =3D new UserTransactionImpl(superuser); utx.begin(); Node n1 =3D testRootNode.addNode(nodeName1); n1.addMixin(mixLockable); n1.addMixin(mixReferenceable); testRootNode.save(); String uuid =3D n1.getUUID(); utx.commit(); Session other1 =3D helper.getSuperuserSession(); utx =3D new UserTransactionImpl(other1); utx.begin(); n1 =3D other1.getNodeByUUID(uuid); Lock lock =3D n1.lock(true, false); String lockToken =3D lock.getLockToken(); //other1.removeLockToken(lockToken); utx.commit(); //other1.logout(); Session other2 =3D helper.getSuperuserSession(); utx =3D new UserTransactionImpl(other2); utx.begin(); other2.addLockToken(lockToken); n1 =3D other2.getNodeByUUID(uuid); n1.unlock(); -> Throws Exception -> Node not locked by this Session ! utx.commit(); ------------------------------------------------------------ 1. In the first Transaction i will create a node 2. In the second Transaction i will lock the node 3. and in the third Transaction i will remove the lock from the node Info: we are using jackrabbit with the JCA Connector and so i will get a = JCASessionHandle to the underlying XASession. Now i have some Problems :-) ... A Node is not unlockable while the = Lock-Creating-Session will be logged out or the LockToken will be removed from the Lock-Creating-Session. In a JCA Environment the session.logout() will be delayed till the = JCAManagedConnection will be destroyed from the container so a logout could not be guaranteed. Removing the LockToken from the Lock-Creating-Session in a XAEnvironment = will end up in a empty Method XAEnvironment.removeLockToken() so in the referenced LockInfo Object is = still the LockOwner the Lock-Creating-Session. I don't know the best solution. We can set the LockHolder to null but = then we must change some code in LockMangager.isLockHolder because this method checks if the given = Session is equals the LockHolder and this is not the case with a non session scoped lock. What do others think ? greets claus