2 Replies Latest reply on Feb 26, 2013 12:08 PM by talawahdotnet

    Calling clear() on a transactional cache via JMX fails with a IllegalStateException

    talawahdotnet

      I have encountered what appears to be a bug when attempting to clear() a transactional cache using JMX (JConsole). 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 as far as I know that is not possible to do that via JMX.

       

      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 truned 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 was able to work around the issue by enabling autocommit for my caches, but that doesn't seem like the ideal thing to do.  Should I raise a bug?