[
https://issues.jboss.org/browse/ISPN-2865?page=com.atlassian.jira.plugin....
]
Mircea Markus commented on ISPN-2865:
-------------------------------------
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/ma...]
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/ma...]
. 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/ma...].
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