JBoss.org Community Documentation
Optimistic locking is enabled by using the NodeLockingScheme XML attribute, and setting it to "OPTIMISTIC":
...
<!--
Node locking scheme:
OPTIMISTIC
PESSIMISTIC (default)
-->
<attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
...
It is generally advisable that if you have an eviction policy defined along with optimistic locking, you
define
the eviction policy's
minTimeToLiveSeconds
parameter to be slightly greater than the transaction
timeout value set in your transaction manager. This ensures that data versions in the cache are not
evicted
while transactions are in progress
[8]
.