]
Paul Ferraro closed WFLY-6056.
------------------------------
Resolution: Duplicate Issue
Duplicate of WFLY-5998.
Session.invalidate() exception with OPTIMISTIC cache configuration
------------------------------------------------------------------
Key: WFLY-6056
URL:
https://issues.jboss.org/browse/WFLY-6056
Project: WildFly
Issue Type: Bug
Components: Clustering
Affects Versions: 10.0.0.CR5
Reporter: Juan AMAT
Assignee: Paul Ferraro
We have an application that must handle 'long' async requests and regular
requests at the same time.
We have the same problem as described here:
https://developer.jboss.org/thread/254200
If I use the configuration that is described in this discussion:
<replicated-cache name="repl" mode="ASYNC"
batching="true">
<transaction locking="OPTIMISTIC"/>
<locking isolation="READ_COMMITTED"/>
<file-store/>
</replicated-cache>
then everything is fine until I call session.invalidate(). In this case I get an
exception:
Caused by: java.lang.UnsupportedOperationException: Calling lock() on non-transactional
caches is not allowed
at org.infinispan.cache.impl.CacheImpl.lock(CacheImpl.java:820)
at org.infinispan.cache.impl.DecoratedCache.lock(DecoratedCache.java:136)
at
org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.lock(AbstractDelegatingAdvancedCache.java:177)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove(InfinispanSessionMetaDataFactory.java:124)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove(InfinispanSessionMetaDataFactory.java:39)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.remove(InfinispanSessionFactory.java:89)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.remove(InfinispanSessionFactory.java:40)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSession.invalidate(InfinispanSession.java:67)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSessionManager$SchedulableSession.invalidate(InfinispanSessionManager.java:439)
at
org.wildfly.clustering.web.undertow.session.DistributableSession.invalidate(DistributableSession.java:181)
at io.undertow.servlet.spec.HttpSessionImpl.invalidate(HttpSessionImpl.java:199)
Now I modify the configuration and specify <transaction mode="BATCH"
locking="OPTIMISTIC"/>, I do get another exception:
Caused by: org.infinispan.InvalidCacheUsageException: Explicit locking is not allowed
with optimistic caches!
at
org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitLockControlCommand(OptimisticLockingInterceptor.java:142)
at
org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:110)
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
at
org.infinispan.interceptors.TxInterceptor.invokeNextInterceptorAndVerifyTransaction(TxInterceptor.java:157)
at
org.infinispan.interceptors.TxInterceptor.visitLockControlCommand(TxInterceptor.java:215)
at
org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:110)
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
at
org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:113)
at
org.infinispan.commands.AbstractVisitor.visitLockControlCommand(AbstractVisitor.java:163)
at
org.infinispan.statetransfer.TransactionSynchronizerInterceptor.visitLockControlCommand(TransactionSynchronizerInterceptor.java:78)
at
org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:110)
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
at
org.infinispan.statetransfer.StateTransferInterceptor.handleTxCommand(StateTransferInterceptor.java:238)
at
org.infinispan.statetransfer.StateTransferInterceptor.visitLockControlCommand(StateTransferInterceptor.java:102)
at
org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:110)
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
at
org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:107)
at
org.infinispan.interceptors.InvocationContextInterceptor.visitLockControlCommand(InvocationContextInterceptor.java:81)
at
org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:110)
at
org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
at
org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:113)
at
org.infinispan.commands.AbstractVisitor.visitLockControlCommand(AbstractVisitor.java:163)
at
org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:110)
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336)
at org.infinispan.cache.impl.CacheImpl.lock(CacheImpl.java:828)
at org.infinispan.cache.impl.DecoratedCache.lock(DecoratedCache.java:136)
at
org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.lock(AbstractDelegatingAdvancedCache.java:177)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove(InfinispanSessionMetaDataFactory.java:124)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove(InfinispanSessionMetaDataFactory.java:39)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.remove(InfinispanSessionFactory.java:89)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.remove(InfinispanSessionFactory.java:40)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSession.invalidate(InfinispanSession.java:67)
at
org.wildfly.clustering.web.infinispan.session.InfinispanSessionManager$SchedulableSession.invalidate(InfinispanSessionManager.java:439)
at
org.wildfly.clustering.web.undertow.session.DistributableSession.invalidate(DistributableSession.java:181)
at io.undertow.servlet.spec.HttpSessionImpl.invalidate(HttpSessionImpl.java:199)
Is there some other configuration that I should use?