Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 93156 invoked from network); 18 Jul 2008 16:32:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jul 2008 16:32:56 -0000 Received: (qmail 77714 invoked by uid 500); 18 Jul 2008 16:32:53 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 77686 invoked by uid 500); 18 Jul 2008 16:32:52 -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 77662 invoked by uid 99); 18 Jul 2008 16:32:52 -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 09:32:52 -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 16:32:07 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C3631234C177 for ; Fri, 18 Jul 2008 09:32:31 -0700 (PDT) Message-ID: <1591748928.1216398751796.JavaMail.jira@brutus> Date: Fri, 18 Jul 2008 09:32:31 -0700 (PDT) From: "Alexander Klimetschek (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Resolved: (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.= jira.plugin.system.issuetabpanels:all-tabpanel ] Alexander Klimetschek resolved JCR-1685. ---------------------------------------- Resolution: Duplicate Thanks for the test case, the problem is already known. Changing it require= s a lot of changes to the code. Do you currently have any real issues with = it? (A version node in the versioning subtree that is not referenced by any= node in the workspace is not nice, but not a big issue IMHO). > 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.