This content has been marked as final.
Show 2 replies
-
1. Re: How to configure and use pessimistic lock in Wildfly10/EAP7 cluster?
galder.zamarreno May 2, 2018 8:00 AM (in response to pahuang)Several potential causes:
* the cache name is wrong (DOC_PROCESS_CACHE)?
* Errors/warnings in log (Enable TRACE to see what's up)? Maybe transaction manager is not being located?
* Configuration is being overriden/ignored - log or stepping through the code
* Bug? Attach a reproducable environment, or try with latest Wildfly (maybe it's been fixed)?
-
2. Re: How to configure and use pessimistic lock in Wildfly10/EAP7 cluster?
pferraro Jun 4, 2018 9:54 PM (in response to galder.zamarreno)In WF10/EAP7, cache configurations are installed on-demand, thus, the above code is not sufficient to ensure that your "doc-lock" cache configuration is installed into the mt-cluster-cache container.
To properly inject a configured cache into your application, add the following to your deployment descriptor:
<resource-ref> <res-ref-name>infinispan/doc-lock</res-ref-name> <lookup-name>java:jboss/infinispan/cache/mt-cluster-cache/doc-lock</lookup-name> </resource-ref>
Now, inject the cache itself into your class:
@Resource(name="infinispan/doc-lock") private Cache<DocumentProcessKey, Boolean> cache;