I'm using:
Hibernate 3.2.3
JBossCache 1.4.1SP3 with pessimistic locking
I'm having considerable problems doing bulk updates with jbosscache. Something in the way hibernate evicts entities for jbossCache after a bulk update gives me major locking problems if I read any of the objects involved in the bulk update within the same transaction as the bulk update.
I've tried setting CacheMode.IGNORE on the session in that transaction with no luck.
Anyone have any ideas or experienced the same? If not or if this is expected I'll see if I can create a simple test case and submit a jira issue.
Mike
Code:
16:44:17,795 ERROR ActionQueue: could not release a cache lock
org.hibernate.cache.CacheException: org.jboss.cache.lock.TimeoutException: failure acquiring lock: fqn=/cdol2/model/OrganizationControl, caller=Thread[main,5,main], lock=write owner=GlobalTransaction:<null>:69 (org.jboss.cache.lock.LockStrategyReadCommitted@19ca84)
at org.hibernate.cache.TreeCache.clear(TreeCache.java:124)
at org.hibernate.cache.TransactionalCache.clear(TransactionalCache.java:124)
at org.hibernate.impl.SessionFactoryImpl.evictEntity(SessionFactoryImpl.java:832)
at org.hibernate.action.BulkOperationCleanupAction.evictEntityRegions(BulkOperationCleanupAction.java:137)
at org.hibernate.action.BulkOperationCleanupAction.afterTransactionCompletion(BulkOperationCleanupAction.java:116)
at org.hibernate.engine.ActionQueue.afterTransactionCompletion(ActionQueue.java:170)
at org.hibernate.impl.SessionImpl.afterTransactionCompletion(SessionImpl.java:424)
at org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:225)
at org.hibernate.transaction.CacheSynchronization.afterCompletion(CacheSynchronization.java:85)
at org.objectweb.jotm.SubCoordinator.doAfterCompletion(SubCoordinator.java:1569)
at org.objectweb.jotm.SubCoordinator.doRollback(SubCoordinator.java:1370)
at org.objectweb.jotm.SubCoordinator.rollback(SubCoordinator.java:330)
at org.objectweb.jotm.TransactionImpl.rollback(TransactionImpl.java:668)
at org.objectweb.jotm.Current.rollback(Current.java:538)
at org.springframework.transaction.jta.JtaTransactionManager.doRollback(JtaTransactionManager.java:863)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:742)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:719)
at org.springframework.test.AbstractTransactionalSpringContextTests.endTransaction(AbstractTransactionalSpringContextTests.java:280)
at org.springframework.test.AbstractTransactionalSpringContextTests.onTearDown(AbstractTransactionalSpringContextTests.java:224)
at org.springframework.test.AbstractSingleSpringContextTests.tearDown(AbstractSingleSpringContextTests.java:125)
at junit.framework.TestCase.runBare(TestCase.java:130)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
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 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:128)
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.jboss.cache.lock.TimeoutException: failure acquiring lock: fqn=/cdol2/model/OrganizationControl, caller=Thread[main,5,main], lock=write owner=GlobalTransaction:<null>:69 (org.jboss.cache.lock.LockStrategyReadCommitted@19ca84)
at org.jboss.cache.Node.acquire(Node.java:500)
at org.jboss.cache.interceptors.PessimisticLockInterceptor.acquireNodeLock(PessimisticLockInterceptor.java:379)
at org.jboss.cache.interceptors.PessimisticLockInterceptor.lock(PessimisticLockInterceptor.java:307)
at org.jboss.cache.interceptors.PessimisticLockInterceptor.invoke(PessimisticLockInterceptor.java:181)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:32)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:365)
at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:160)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:183)
at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:5863)
at org.jboss.cache.TreeCache.remove(TreeCache.java:3871)
at org.hibernate.cache.TreeCache.clear(TreeCache.java:121)
... 33 more
Caused by: org.jboss.cache.lock.TimeoutException: write lock for /cdol2/model/OrganizationControl could not be acquired after 1000 ms. Locks: Read lock owners: []
Write lock owner: GlobalTransaction:<null>:69
(caller=Thread[main,5,main], lock info: write owner=GlobalTransaction:<null>:69 (org.jboss.cache.lock.LockStrategyReadCommitted@19ca84))
at org.jboss.cache.lock.IdentityLock.acquireWriteLock(IdentityLock.java:206)
at org.jboss.cache.Node.acquireWriteLock(Node.java:529)
at org.jboss.cache.Node.acquire(Node.java:476)
... 46 more