JBoss.org Community Documentation

10.1.3. Optimistic Locking

The motivation for optimistic locking is to improve concurrency. When a lot of threads have a lot of contention for access to the data tree, it can be inefficient to lock portions of the tree - for reading or writing - for the entire duration of a transaction as we do in pessimistic locking. Optimistic locking allows for greater concurrency of threads and transactions by using a technique called data versioning, explained here. Note that isolation levels (if configured) are ignored if optimistic locking is enabled.



[7] Because of this requirement, you must always have a transaction manager configured when using optimistic locking.

[8] See JBCACHE-1155