0

I got this exception in wildfly-8.2 domain mode:

Caused by: Unable to acquire lock after [15 seconds] on key [app.entity.UserData#17568183] for requestor [GlobalTransaction::2482:remote]! Lock held by [GlobalTransaction::2135:remote] at org.infinispan.util.concurrent.locks.LockManagerImpl (line 198)

Here is the settings:

               <subsystem xmlns="urn:jboss:domain:infinispan:2.0">
            <cache-container name="server" default-cache="default" module="org.wildfly.clustering.server" aliases="singleton cluster">
                <transport lock-timeout="120000"/>
                <replicated-cache name="default" batching="true" mode="SYNC">
                    <locking isolation="REPEATABLE_READ"/>
                </replicated-cache>
            </cache-container>
            <cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">
                <transport lock-timeout="120000"/>
                <distributed-cache name="dist" batching="true" mode="ASYNC" owners="2" l1-lifespan="0">
                    <locking isolation="REPEATABLE_READ" acquire-timeout="300000" concurrency-level="1000"/>
                    <file-store/>
                </distributed-cache>
            </cache-container>
            <cache-container name="ejb" default-cache="dist" module="org.wildfly.clustering.ejb.infinispan" aliases="sfsb">
                <transport lock-timeout="120000"/>
                <distributed-cache name="dist" batching="true" mode="ASYNC" owners="2" l1-lifespan="0">
                    <file-store passivation="true"/>
                </distributed-cache>
            </cache-container>
            <cache-container name="hibernate" default-cache="local-query" module="org.hibernate">
                <transport lock-timeout="120000"/>
                <local-cache name="local-query">
                    <transaction mode="NONE"/>
                    <eviction strategy="LRU" max-entries="10000"/>
                    <expiration max-idle="100000"/>
                </local-cache>
                <invalidation-cache name="entity" mode="SYNC">
                    <transaction mode="NON_XA"/>
                    <eviction strategy="LRU" max-entries="10000"/>
                    <expiration max-idle="100000"/>
                </invalidation-cache>
                <replicated-cache name="timestamps" mode="ASYNC">
                    <transaction mode="NONE"/>
                    <eviction strategy="NONE"/>
                </replicated-cache>
            </cache-container>
        </subsystem>

I am using XA-DataSource. What change is required to fix this issue?

Valsaraj Viswanathan
  • 1,473
  • 5
  • 28
  • 51

1 Answers1

1

I also get this exception with Wildfly 10.1 in domain mode and the same config.

If I disable the Cache for a specific entity there is no such exception.

The error occurs if in a first attempt to store the entity the transaction is rolled back due to some exception after the entity was flushed to the entity manager / database. And then in a second attempt (without exception after the flush) I run into this lock exception. So I think it might be related to some transaction stuff. A transaction that is not rolled back (correctly)!?

If the second attempt is started after about 2 minutes after the first attempt with the exception/rollback it works. This is probably because of the expiration timeout of 100.000 ms = 1min 40sec.

Also see here: https://developer.jboss.org/thread/260634

  • 1
    This post looks at first a lot like a "me too!", but there is an actual answer buried in there. You could probably reorganise it so that the answer is more obvious. Since you had the same problem, I expect others will too, and a few edits will make this answer easier to find and easier to use – Peter Hall Jun 10 '17 at 22:11