[infinispan-issues] [JBoss JIRA] (ISPN-2865) Error calling clear() via JMX on a transactional cache with autoCommit=false
Mircea Markus (JIRA)
jira-events at lists.jboss.org
Thu Feb 28 13:05:56 EST 2013
[ https://issues.jboss.org/browse/ISPN-2865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757613#comment-12757613 ]
Mircea Markus edited comment on ISPN-2865 at 2/28/13 1:04 PM:
--------------------------------------------------------------
The fix is not as trivial as expected.
It requires adding a a new method on CacheImpl, different that clear, which would always start a transaction for tx caches, and this metod to be exposed under the "clear" JMX operation. The problem is that when doing @ManagedOperation(name="clear") doesn't do the trick - might be a problem with the JMX annotation fwk, to be investigated.
was (Author: mircea.markus):
The fix is not as trivial as expected.
It requires adding a a new mothod on CacheImpl, different that clear, which would always start a transaction for tx caches, and this metod to be exposed under the "clear" JMX operation. The problem is that when doing @ManagedOperation(name="clear") doesn't do the trick - might be a problem with the JMX annotation fwk, to be investigated.
> 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
> Labels: 5.2.x
> Fix For: 5.2.3.Final, 5.3.0.Final
>
>
> 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