1 Reply Latest reply on Jul 10, 2017 5:48 AM by Pedro Ruivo

    Reading data on ABORT_ONLY transaction

    Anatoly Satanovskiy Newbie

      Hello everyone

       

      We have a need to read data on a transaction that is in ABORT_ONLY state.

      By checking JBoss Cache 3.x we see that it is permitted but when using Infinispan it gives the following error

       

      ISPN000136: Error executing command GetKeyValueCommand, writing keys []: java.lang.IllegalStateException: Transaction TransactionImple < ac, BasicAction: 0:ffff7f000101:-36e6e1c9:595b5ee2:2f status: ActionStatus.ABORT_ONLY > is not in a valid state to be invoking cache operations on.

          at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:395)

          at org.infinispan.interceptors.TxInterceptor.enlistIfNeeded(TxInterceptor.java:351)

          at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:345)

          at org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:331)

          at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:43)

          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)

          at org.infinispan.interceptors.CacheMgmtInterceptor.visitDataReadCommand(CacheMgmtInterceptor.java:103)

          at org.infinispan.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:91)

          at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:43)

          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)

          at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:114)

          at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:83)

          at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:85)

          at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:43)

          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)

          at org.infinispan.interceptors.BatchingInterceptor.handleDefault(BatchingInterceptor.java:67)

          at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:85)

          at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:43)

          at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:335)

          at org.infinispan.cache.impl.CacheImpl.get(CacheImpl.java:411)

          at org.infinispan.cache.impl.CacheImpl.get(CacheImpl.java:403)

       

      Using Infinispan version: 8.2.4

       

      Can you please suggest what is the best behavior to allow following for Infinispan?

        • 1. Re: Reading data on ABORT_ONLY transaction
          Pedro Ruivo Novice

          Hi Anatoly,

           

          Since Infinispan 4 we don't allow operations to proceed if the transaction isn't active (i.e. running). The reason for that is to avoid allocating transactional resources in Infinispan that will be discarded later.

           

          In your case, the transaction is marked for rollback, so why do you want to execute operations on it? What is your use case?

           

          Said that, Infinispan can be changed to allow operation on that state. If you really need it, you can open a JIRA - JBoss Issue Tracker with your use case.

           

          Cheers,

          Pedro