[infinispan-issues] [JBoss JIRA] (ISPN-2865) Error calling clear() via JMX on a transactional cache with autoCommit=false

Marc Richards (JIRA) jira-events at lists.jboss.org
Tue Feb 26 12:07:56 EST 2013


Marc Richards created ISPN-2865:
-----------------------------------

             Summary: Error calling clear() via JMX on a transactional cache with autoCommit=false
                 Key: ISPN-2865
                 URL: https://issues.jboss.org/browse/ISPN-2865
             Project: Infinispan
          Issue Type: Bug
          Components: JMX, reporting and management
    Affects Versions: 5.2.1.Final
         Environment: Apache Tomcat on Linux and Windows
            Reporter: Marc Richards
            Assignee: Mircea Markus


Calling clear() via JMX (e.g. JConsole) on a transactional cache with autoCommit="false" fails with an IllegalStateException.

Looking at the source code it would appear that the expectation is that the call to clear() would have been wrapped in a transaction, however that is not currently happening for calls made via JMX if autoCommit="false".
 
The [clear() method in CacheImpl.java line 321|https://github.com/infinispan/infinispan/blob/5.2.1.Final/core/src/main/java/org/infinispan/CacheImpl.java#L321] calls getInvocationContextWithImplicitTransaction() which tests to see if there is an ongoing transaction [on line 482|https://github.com/infinispan/infinispan/blob/5.2.1.Final/core/src/main/java/org/infinispan/CacheImpl.java#L482] .  If autocommit is turned on, it will automatically create an implicit transaction, but if it is off as I had it, it will simply call createInvocationContext() and throw an IllegalStateException when it sees that the transaction is still null in [TransactionalInvocationContextContainer.java on line 112|https://github.com/infinispan/infinispan/blob/5.2.1.Final/core/src/main/java/org/infinispan/context/TransactionalInvocationContextContainer.java#L112].

I currently work around the issue by setting autoCommit="true", but that is not an ideal solution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the infinispan-issues mailing list