jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KÖLL Claus <C.KO...@TIROL.GV.AT>
Subject lock problem in xa transaction
Date Wed, 30 Jul 2008 07:46:29 GMT
if i try a testcase like this ...

 

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();

 

}

 

i get a exception while commit()

 

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)

         ... 30 more

 

thanks for help

claus


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message