Show Table of Contents
14.2. Configure Locking (Library Mode)
For Library mode, the
locking element and its parameters are set within the default element and for each named cache, it occurs within the namedCache element. The following is an example of this configuration:
Procedure 14.2. Configure Locking (Library Mode)
<infinispan>
<!-- Other configuration elements here -->
<default>
<locking concurrencyLevel="${VALUE}"
isolationLevel="${LEVEL}"
lockAcquisitionTimeout="${TIME}"
useLockStriping="${TRUE/FALSE}"
writeSkewCheck="${TRUE/FALSE}" />- The
concurrencyLevelparameter specifies the concurrency level for the lock container. Set this value according to the number of concurrent threads interacting with the data grid. - The
isolationLevelparameter specifies the cache's isolation level. Valid isolation levels areREAD_COMMITTEDandREPEATABLE_READ. For details about isolation levels, see Section 16.1, “About Isolation Levels” - The
lockAcquisitionTimeoutparameter specifies time (in milliseconds) after which a lock acquisition attempt times out. - The
useLockStripingparameter specifies whether a pool of shared locks are maintained for all entries that require locks. If set toFALSE, locks are created for each entry in the cache. For details, see Section 15.1, “About Lock Striping” - The
writeSkewCheckparameter is only valid if theisolationLevelis set toREPEATABLE_READ. If this parameter is set toFALSE, a disparity between a working entry and the underlying entry at write time results in the working entry overwriting the underlying entry. If the parameter is set toTRUE, such conflicts (namely write skews) throw an exception. ThewriteSkewCheckparameter can be only used withOPTIMISTICtransactions and it requires entry versioning to be enabled, withSIMPLEversioning scheme.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.