Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2815

Put to Transactional cache with enabled indexing to InfinispanDirectory doesn't work properly

XMLWordPrintable

      In case when using Index enabled cache (no-matter in which mode), with enabled InfinispanDirectory and enabled transactions, the cache put throws exception, although then the data appears in the cache.

      But then, when query is performed on that cache, it doesn't return any result.

      The cache config is:

      ConfigurationBuilder c = getDefaultStandaloneCacheConfig(true);
      c.indexing()
             .enable()
             .indexLocalOnly(true)
             .addProperty("hibernate.search.default.indexmanager", "org.infinispan.query.indexmanager.InfinispanIndexManager")
             .addProperty("hibernate.search.default.directory_provider", "infinispan")
             .addProperty("hibernate.search.default.exclusive_index_use", "false")
             .addProperty("lucene_version", "LUCENE_36");
      TestCacheManagerFactory.createCacheManager(c);
      

      While performing put to the created cache, the following exception appears in the logs, although the program flow continues properly:

      2013-02-12 13:03:00,733 ERROR [InvocationContextInterceptor] (Hibernate Search: Index updates queue processor for index indexA-1) ISPN000136: Execution error
      org.infinispan.util.concurrent.TimeoutException: Unable to acquire lock after [10 seconds] on key [write.lock|M|indexA] for requestor [GlobalTransaction:<null>:5:local]! Lock held by [GlobalTransaction:<null>:3:local]
      	at org.infinispan.util.concurrent.locks.LockManagerImpl.lock(LockManagerImpl.java:213)
      	at org.infinispan.util.concurrent.locks.LockManagerImpl.acquireLock(LockManagerImpl.java:186)
      	at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.lockKeyAndCheckOwnership(AbstractTxLockingInterceptor.java:186)
      	at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.lockAndRegisterBackupLock(AbstractTxLockingInterceptor.java:123)
      	at org.infinispan.interceptors.locking.OptimisticLockingInterceptor$LockAcquisitionVisitor.lockAndRecord(OptimisticLockingInterceptor.java:254)
      	at org.infinispan.interceptors.locking.OptimisticLockingInterceptor$LockAcquisitionVisitor.visitSingleKeyCommand(OptimisticLockingInterceptor.java:249)
      	at org.infinispan.interceptors.locking.OptimisticLockingInterceptor$LockAcquisitionVisitor.visitPutKeyValueCommand(OptimisticLockingInterceptor.java:242)
      	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
      	at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.acquireLocksVisitingCommands(OptimisticLockingInterceptor.java:335)
      	at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitPrepareCommand(OptimisticLockingInterceptor.java:123)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      	at org.infinispan.interceptors.NotificationInterceptor.visitPrepareCommand(NotificationInterceptor.java:58)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      	at org.infinispan.interceptors.TxInterceptor.invokeNextInterceptorAndVerifyTransaction(TxInterceptor.java:128)
      	at org.infinispan.interceptors.TxInterceptor.visitPrepareCommand(TxInterceptor.java:115)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      	at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:128)
      	at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:92)
      	at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:126)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:343)
      	at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:141)
      	at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:123)
      	at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:68)
      	at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
      	at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
      	at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1172)
      	at org.infinispan.CacheImpl.putIfAbsentInternal(CacheImpl.java:779)
      	at org.infinispan.CacheImpl.putIfAbsent(CacheImpl.java:771)
      	at org.infinispan.DecoratedCache.putIfAbsent(DecoratedCache.java:355)
      	at org.infinispan.lucene.locking.BaseLuceneLock.obtain(BaseLuceneLock.java:63)
      	at org.apache.lucene.store.Lock.obtain(Lock.java:72)
      	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1098)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:148)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:115)
      	at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:117)
      	at org.hibernate.search.backend.impl.lucene.SharedIndexWorkspaceImpl.getIndexWriter(SharedIndexWorkspaceImpl.java:78)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:99)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      	at java.lang.Thread.run(Thread.java:722)
      2013-02-12 13:03:00,738 ERROR [TransactionCoordinator] (Hibernate Search: Index updates queue processor for index indexA-1) Error while processing prepare
      org.infinispan.util.concurrent.TimeoutException: Unable to acquire lock after [10 seconds] on key [write.lock|M|indexA] for requestor [GlobalTransaction:<null>:5:local]! Lock held by [GlobalTransaction:<null>:3:local]
      	at org.infinispan.util.concurrent.locks.LockManagerImpl.lock(LockManagerImpl.java:213)
      	at org.infinispan.util.concurrent.locks.LockManagerImpl.acquireLock(LockManagerImpl.java:186)
      	at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.lockKeyAndCheckOwnership(AbstractTxLockingInterceptor.java:186)
      	at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.lockAndRegisterBackupLock(AbstractTxLockingInterceptor.java:123)
      	at org.infinispan.interceptors.locking.OptimisticLockingInterceptor$LockAcquisitionVisitor.lockAndRecord(OptimisticLockingInterceptor.java:254)
      	at org.infinispan.interceptors.locking.OptimisticLockingInterceptor$LockAcquisitionVisitor.visitSingleKeyCommand(OptimisticLockingInterceptor.java:249)
      	at org.infinispan.interceptors.locking.OptimisticLockingInterceptor$LockAcquisitionVisitor.visitPutKeyValueCommand(OptimisticLockingInterceptor.java:242)
      	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
      	at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.acquireLocksVisitingCommands(OptimisticLockingInterceptor.java:335)
      	at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitPrepareCommand(OptimisticLockingInterceptor.java:123)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      	at org.infinispan.interceptors.NotificationInterceptor.visitPrepareCommand(NotificationInterceptor.java:58)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      	at org.infinispan.interceptors.TxInterceptor.invokeNextInterceptorAndVerifyTransaction(TxInterceptor.java:128)
      	at org.infinispan.interceptors.TxInterceptor.visitPrepareCommand(TxInterceptor.java:115)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      	at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:128)
      	at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:92)
      	at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:126)
      	at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:124)
      	at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:343)
      	at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:141)
      	at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:123)
      	at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:68)
      	at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
      	at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
      	at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1172)
      	at org.infinispan.CacheImpl.putIfAbsentInternal(CacheImpl.java:779)
      	at org.infinispan.CacheImpl.putIfAbsent(CacheImpl.java:771)
      	at org.infinispan.DecoratedCache.putIfAbsent(DecoratedCache.java:355)
      	at org.infinispan.lucene.locking.BaseLuceneLock.obtain(BaseLuceneLock.java:63)
      	at org.apache.lucene.store.Lock.obtain(Lock.java:72)
      	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1098)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:148)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:115)
      	at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:117)
      	at org.hibernate.search.backend.impl.lucene.SharedIndexWorkspaceImpl.getIndexWriter(SharedIndexWorkspaceImpl.java:78)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:99)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      	at java.lang.Thread.run(Thread.java:722)
      2013-02-12 13:03:00,742 WARN  [arjuna] (Hibernate Search: Index updates queue processor for index indexA-1) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffff0a22814f:cd67:511a2f6a:9, SynchronizationAdapter{localTransaction=LocalTransaction{remoteLockedNodes=null, isMarkedForRollback=false, lockedKeys=null, backupKeyLocks=null, topologyId=-1, isFromStateTransfer=false} org.infinispan.transaction.synchronization.SyncLocalTransaction@5} org.infinispan.transaction.synchronization.SynchronizationAdapter@24 >
      org.infinispan.CacheException: Could not prepare. 
      	at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:70)
      	at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
      	at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
      	at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1172)
      	at org.infinispan.CacheImpl.putIfAbsentInternal(CacheImpl.java:779)
      	at org.infinispan.CacheImpl.putIfAbsent(CacheImpl.java:771)
      	at org.infinispan.DecoratedCache.putIfAbsent(DecoratedCache.java:355)
      	at org.infinispan.lucene.locking.BaseLuceneLock.obtain(BaseLuceneLock.java:63)
      	at org.apache.lucene.store.Lock.obtain(Lock.java:72)
      	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1098)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:148)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:115)
      	at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:117)
      	at org.hibernate.search.backend.impl.lucene.SharedIndexWorkspaceImpl.getIndexWriter(SharedIndexWorkspaceImpl.java:78)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:99)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      	at java.lang.Thread.run(Thread.java:722)
      Caused by: javax.transaction.xa.XAException
      	at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:161)
      	at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:123)
      	at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:68)
      	... 25 more
      2013-02-12 13:03:00,744 WARN  [CacheImpl] (Hibernate Search: Index updates queue processor for index indexA-1) ISPN000160: Could not complete injected transaction.
      javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1177)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
      	at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1172)
      	at org.infinispan.CacheImpl.putIfAbsentInternal(CacheImpl.java:779)
      	at org.infinispan.CacheImpl.putIfAbsent(CacheImpl.java:771)
      	at org.infinispan.DecoratedCache.putIfAbsent(DecoratedCache.java:355)
      	at org.infinispan.lucene.locking.BaseLuceneLock.obtain(BaseLuceneLock.java:63)
      	at org.apache.lucene.store.Lock.obtain(Lock.java:72)
      	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1098)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:148)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:115)
      	at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:117)
      	at org.hibernate.search.backend.impl.lucene.SharedIndexWorkspaceImpl.getIndexWriter(SharedIndexWorkspaceImpl.java:78)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:99)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      	at java.lang.Thread.run(Thread.java:722)
      Caused by: org.infinispan.CacheException: Could not prepare. 
      	at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:70)
      	at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
      	at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
      	... 20 more
      Caused by: javax.transaction.xa.XAException
      	at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:161)
      	at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:123)
      	at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:68)
      	... 25 more
      2013-02-12 13:03:00,745 ERROR [LuceneBackendQueueTask] (Hibernate Search: Index updates queue processor for index indexA-1) HSEARCH000073: Error in backend
      org.infinispan.CacheException: Could not commit implicit transaction
      	at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1175)
      	at org.infinispan.CacheImpl.putIfAbsentInternal(CacheImpl.java:779)
      	at org.infinispan.CacheImpl.putIfAbsent(CacheImpl.java:771)
      	at org.infinispan.DecoratedCache.putIfAbsent(DecoratedCache.java:355)
      	at org.infinispan.lucene.locking.BaseLuceneLock.obtain(BaseLuceneLock.java:63)
      	at org.apache.lucene.store.Lock.obtain(Lock.java:72)
      	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1098)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:148)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:115)
      	at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:117)
      	at org.hibernate.search.backend.impl.lucene.SharedIndexWorkspaceImpl.getIndexWriter(SharedIndexWorkspaceImpl.java:78)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:99)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      	at java.lang.Thread.run(Thread.java:722)
      Caused by: javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1177)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
      	at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1172)
      	... 18 more
      Caused by: org.infinispan.CacheException: Could not prepare. 
      	at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:70)
      	at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
      	at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
      	... 20 more
      Caused by: javax.transaction.xa.XAException
      	at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:161)
      	at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:123)
      	at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:68)
      	... 25 more
      2013-02-12 13:03:00,748 ERROR [LogErrorHandler] (Hibernate Search: Index updates queue processor for index indexA-1) HSEARCH000058: Exception occurred org.infinispan.CacheException: Could not commit implicit transaction
      Primary Failure:
      	Entity org.infinispan.query.api.TestEntity  Id L:10  Work Type  org.hibernate.search.backend.UpdateLuceneWork
      
      org.infinispan.CacheException: Could not commit implicit transaction
      	at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1175)
      	at org.infinispan.CacheImpl.putIfAbsentInternal(CacheImpl.java:779)
      	at org.infinispan.CacheImpl.putIfAbsent(CacheImpl.java:771)
      	at org.infinispan.DecoratedCache.putIfAbsent(DecoratedCache.java:355)
      	at org.infinispan.lucene.locking.BaseLuceneLock.obtain(BaseLuceneLock.java:63)
      	at org.apache.lucene.store.Lock.obtain(Lock.java:72)
      	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1098)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:148)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:115)
      	at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:117)
      	at org.hibernate.search.backend.impl.lucene.SharedIndexWorkspaceImpl.getIndexWriter(SharedIndexWorkspaceImpl.java:78)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:99)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      	at java.lang.Thread.run(Thread.java:722)
      Caused by: javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1177)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
      	at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1172)
      	... 18 more
      Caused by: org.infinispan.CacheException: Could not prepare. 
      	at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:70)
      	at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
      	at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
      	... 20 more
      Caused by: javax.transaction.xa.XAException
      	at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:161)
      	at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:123)
      	at org.infinispan.transaction.synchronization.SynchronizationAdapter.beforeCompletion(SynchronizationAdapter.java:68)
      	... 25 more
      

      After the put, the entries are in the cache, but the querying doesn't return results.

      You can find attached the failing test.

      IMPORTANT UPDATE: After looking deeper into the failure and into the failed cases, I've found out that this issue appears only if the ISPN Directory related caches are TRANSACTIONAL. If only the data storage cache is transactional, then no issue appears. E.g. if there is no specific caches are defined for ISPN directory (for index storing), then the caches are created from the default configuration (LuceneIndexesMetadata, LuceneIndexesData, LuceneIndexesLocking), and if the default configuration is set to be TRANSACTIONAL (which is the case described in the attachments), then this issue will appear.

              pruivo@redhat.com Pedro Ruivo
              amanukya@redhat.com Anna Manukyan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: