Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 12881 invoked from network); 18 Jul 2008 17:05:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jul 2008 17:05:23 -0000 Received: (qmail 17618 invoked by uid 500); 18 Jul 2008 17:05:22 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 17578 invoked by uid 500); 18 Jul 2008 17:05:22 -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 17567 invoked by uid 99); 18 Jul 2008 17:05:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jul 2008 10:05:22 -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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jul 2008 17:04:37 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BDEC1234C174 for ; Fri, 18 Jul 2008 10:04:31 -0700 (PDT) Message-ID: <734905508.1216400671776.JavaMail.jira@brutus> Date: Fri, 18 Jul 2008 10:04:31 -0700 (PDT) From: =?utf-8?Q?R=C3=BCdiger_Gro=C3=9F-Hardt_=28JIRA=29?= To: dev@jackrabbit.apache.org Subject: [jira] Commented: (JCR-1685) Version node still accessible after transaction rollback In-Reply-To: <1779708072.1216396951780.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-1685?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D126147= 89#action_12614789 ]=20 R=C3=BCdiger Gro=C3=9F-Hardt commented on JCR-1685: ----------------------------------------- >> Thanks for the test case, the problem is already known. Changing it requ= ires a lot of changes to the code.=20 I do not quite agree, because to me the rollback on the versioning db conne= ction seems to fail all the time, while the other issue is really categoriz= ed as an improvement and merely mentions a possible problem. Which is BTW, = why I felt this was a new issue.=20 >> Do you currently have any real issues with it? (A version node in the ve= rsioning subtree that is not referenced by any node in the workspace is not= nice, but not a big issue IMHO). As the code indicates, I have found a workaround, so no, we do not have a r= eal issue with it so far. > Version node still accessible after transaction rollback > -------------------------------------------------------- > > Key: JCR-1685 > URL: https://issues.apache.org/jira/browse/JCR-1685 > Project: Jackrabbit > Issue Type: Bug > Components: jackrabbit-core, transactions, versioning > Affects Versions: core 1.4.5 > Environment: Windows Vista, Java 1.5.0, Derby Database for versio= ning and workspace, JUnit 4 Testcase > Reporter: R=C3=BCdiger Gro=C3=9F-Hardt > Attachments: TransactionTest.java, UserTransactionImpl.java > > > * Open a transaction > * Add a new versionable node and check it in > * Save the uuid of the version node returned by node.checkin() > * Rollback transaction AND call session.refresh(false) > * access version (!) node by session.getNodeByUUID() > =3D=3D> in spite of the rollback the version node is still found. If the = path of the version node is used to look it up (session.getItem()), it fail= s > The following JUnit 4 test case demonstrates the problem: > @Test > public void testRollbackInline() throws Exception { > // start transaction for session > UserTransactionImpl tx =3D new UserTransactionImpl(superuser); > tx.begin(); > // add new node and save > Node node =3D superuser.getRootNode().addNode("test001", "nt:unst= ructured"); > node.addMixin("mix:versionable"); > superuser.save(); > // checkin version and save uuid > Version v =3D node.checkin(); > String uuid =3D v.getUUID(); > // rollback transaction for session > tx.rollback(); > // clear transient storage > superuser.refresh(false); > // check, whether new version was really "rolled back" > assertFalse(hasVersionWorks(uuid)); > assertFalse(hasVersionFails(uuid)); > } > private boolean hasVersionFails(String versionId) throws RepositoryEx= ception { > boolean hasVersion; > try { > Node nodeByUUID =3D superuser.getNodeByUUID(versionId); > hasVersion =3D nodeByUUID !=3D null; > } catch (ItemNotFoundException e) { > hasVersion =3D false; > } > if (hasVersion) > System.err.println("hasVersionFailing: " + versionId + " =3D= =3D> FOUND"); > else > System.err.println("hasVersionFailing: " + versionId + " =3D= =3D> NOT FOUND"); > return hasVersion; > } > private boolean hasVersionWorks(String versionId) throws RepositoryEx= ception { > boolean hasVersion; > try { > Node nodeByUUID =3D superuser.getNodeByUUID(versionId); > String path =3D nodeByUUID.getPath(); > hasVersion =3D superuser.itemExists(path); > } catch (ItemNotFoundException e) { > hasVersion =3D false; > } > if (hasVersion) > System.err.println("hasVersionWorking: " + versionId + " =3D= =3D> FOUND"); > else > System.err.println("hasVersionWorking: " + versionId + " =3D= =3D> NOT FOUND"); > return hasVersion; > } > I will try to attach the complete test sources, which also shows the setu= p of the repository, though I did nothing special there. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.