Issues with modeshape JCR search in transactional mode
satyakishor.m Apr 1, 2013 2:27 PMI am trying to insert nodes into repository as batch within an EJB transaction. Nodes are getting created successfully but for some reason search is not returing any nodes. I see the following warning messages in the server log when inserting nodes into repo.
14:15:54,452 WARN [com.arjuna.ats.jta] (EJB default - 2) ARJUNA016029: SynchronizationImple.afterCompletion - failed for org.modeshape.jcr.txn.SynchronizedTransactions$SynchronizedTransaction$1@1ea872 with exception: java.lang.IllegalStateException: Transaction TransactionImple < ac, BasicAction: 0:ffff0a0cdc39:392918e1:5159cda2:815 status: ActionStatus.COMMITTED > is not in a valid state to be invoking cache operations on. at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:230) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.interceptors.TxInterceptor.enlistIfNeeded(TxInterceptor.java:194) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:188) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:184) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:60) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:93) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:60) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:130) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:89) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:95) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:60) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:345) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.CacheImpl.get(CacheImpl.java:272) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.CacheImpl.get(CacheImpl.java:264) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.infinispan.AbstractDelegatingCache.get(AbstractDelegatingCache.java:255) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL] at org.modeshape.jcr.value.binary.infinispan.InfinispanBinaryStore.getExtractedText(InfinispanBinaryStore.java:475) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final] at org.modeshape.jcr.value.binary.AbstractBinaryStore.getText(AbstractBinaryStore.java:113) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final] at org.modeshape.jcr.query.lucene.basic.BasicLuceneSchema.addDynamicField(BasicLuceneSchema.java:268) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final] at org.modeshape.jcr.query.lucene.basic.BasicLuceneSchema.nodeInfo(BasicLuceneSchema.java:202) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final] at org.modeshape.jcr.query.lucene.basic.BasicLuceneSchema.updateIndex(BasicLuceneSchema.java:412) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final] at org.modeshape.jcr.JcrRepository$RepositoryMonitorFactory$3.recordUpdate(JcrRepository.java:1867) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final] at org.modeshape.jcr.txn.SynchronizedTransactions$UpdateCall.send(SynchronizedTransactions.java:317) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final] at org.modeshape.jcr.txn.SynchronizedTransactions$AccumulatingMonitor.forward(SynchronizedTransactions.java:255) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final] at org.modeshape.jcr.txn.SynchronizedTransactions$SynchronizedTransaction.afterCommit(SynchronizedTransactions.java:165) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final] at org.modeshape.jcr.txn.SynchronizedTransactions$SynchronizedTransaction$1.afterCompletion(SynchronizedTransactions.java:120) [modeshape-jcr-3.1.3.Final.jar:3.1.3.Final] at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:96) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:402) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:103) 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 com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75) at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:92) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final] at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:232) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final] at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final] at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final] at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final] at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final] at org.jboss.as.ejb3.component.interceptors.AsyncFutureInterceptorFactory$1$1.runInvocation(AsyncFutureInterceptorFactory.java:71) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final] at org.jboss.as.ejb3.component.interceptors.AsyncInvocationTask.run(AsyncInvocationTask.java:73) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_07] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_07] at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_07] at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Is the above warnings are the reason that the indexes are not building properly or Is there any reason for my search not to work properly????
BTW, when I rebuild the indexes using the following statement, search returns the correct nodes.
((org.modeshape.jcr.api.Workspace)session.getWorkspace()).reindexAsync("/");