jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Köll (JIRA) <j...@apache.org>
Subject [jira] Commented: (JCR-1702) Unable to create/lock Node in one Transaction
Date Mon, 04 Aug 2008 08:47:45 GMT

    [ https://issues.apache.org/jira/browse/JCR-1702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619443#action_12619443
] 

Claus Köll commented on JCR-1702:
---------------------------------

a testcase ...

public void testAddNodeAndLock() throws Exception {
  UserTransaction utx = new UserTransactionImpl(superuser);
  // start transaction
  utx.begin();
  
  // add node and save
  Node n = testRootNode.addNode(nodeName1, testNodeType);
  n.addMixin(mixLockable);
  n.addMixin(mixReferenceable);
  testRootNode.save();
 
  n.lock(true, false);
  // verify node is locked in first session only
  assertTrue("Node locked in session 1", n.isLocked());
  // commit
  utx.commit();
  
  // logout
  otherSuperuser.logout();
}

on utx.commit() i get following exception ...

javax.transaction.RollbackException: Transaction rolled back: XA_ERR=104
         at org.apache.jackrabbit.core.UserTransactionImpl.commit(UserTransactionImpl.java:118)
         at org.apache.jackrabbit.core.XATest.testAddNodeAndLock(XATest.java:198)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at org.apache.jackrabbit.core.XATest.runTest(XATest.java:97)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:406)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
         at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.apache.jackrabbit.core.TransactionException: Unable to update.
         at org.apache.jackrabbit.core.lock.XAEnvironment.prepare(XAEnvironment.java:275)
         at org.apache.jackrabbit.core.lock.XALockManager.prepare(XALockManager.java:245)
         at org.apache.jackrabbit.core.TransactionContext.prepare(TransactionContext.java:138)
         at org.apache.jackrabbit.core.XASessionImpl.prepare(XASessionImpl.java:324)
         at org.apache.jackrabbit.core.UserTransactionImpl.commit(UserTransactionImpl.java:107)
         ... 21 more
Caused by: javax.jcr.ItemNotFoundException: failed to build path of 9cd88737-ecfa-49ba-8c30-1e98adf201e9:
9cd88737-ecfa-49ba-8c30-1e98adf201e9: 9cd88737-ecfa-49ba-8c30-1e98adf201e9
         at org.apache.jackrabbit.core.HierarchyManagerImpl.getPath(HierarchyManagerImpl.java:407)
         at org.apache.jackrabbit.core.CachingHierarchyManager.getPath(CachingHierarchyManager.java:272)
         at org.apache.jackrabbit.core.lock.LockManagerImpl.getPath(LockManagerImpl.java:651)
         at org.apache.jackrabbit.core.lock.LockManagerImpl.internalLock(LockManagerImpl.java:276)
         at org.apache.jackrabbit.core.lock.XAEnvironment$LockInfo.update(XAEnvironment.java:409)
         at org.apache.jackrabbit.core.lock.XAEnvironment.prepare(XAEnvironment.java:273)
         ... 25 more
Caused by: org.apache.jackrabbit.core.state.NoSuchItemStateException: 9cd88737-ecfa-49ba-8c30-1e98adf201e9
         at org.apache.jackrabbit.core.state.SessionItemStateManager.getItemState(SessionItemStateManager.java:189)
         at org.apache.jackrabbit.core.HierarchyManagerImpl.getItemState(HierarchyManagerImpl.java:188)
         at org.apache.jackrabbit.core.HierarchyManagerImpl.getPath(HierarchyManagerImpl.java:402)


> Unable to create/lock Node in one Transaction
> ---------------------------------------------
>
>                 Key: JCR-1702
>                 URL: https://issues.apache.org/jira/browse/JCR-1702
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: transactions
>    Affects Versions: core 1.4.5
>            Reporter: Claus Köll
>
> If i try to add a node and then add a lock on it inside one transaction i get a exception

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message