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

Error calling clear() via JMX on a transactional cache with autoCommit=false


      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 calls getInvocationContextWithImplicitTransaction() which tests to see if there is an ongoing transaction on line 482 . 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.

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

            mircea.markus Mircea Markus (Inactive)
            talawahdotnet Marc Richards (Inactive)
            0 Vote for this issue
            2 Start watching this issue