15.3. Configure Lock Striping (Library Mode)


Lock striping is disabled by default in Red Hat JBoss Data Grid. Configure lock striping in JBoss Data Grid's Library mode using the useLockStriping parameter as demonstrated in the following procedure.

Procedure 15.1. Configure Lock Striping (Library Mode)

  1. Set the Concurrency Level

    The concurrencyLevel is used to specify the size of the shared lock collection use when lock striping is enabled.
    <infinispan>
    	...
    	<default>
    	
    		<locking concurrencyLevel="${VALUE}" />
    Copy to Clipboard Toggle word wrap
  2. Set Isolation Level

    The isolationLevel parameter specifies the cache's isolation level. Valid isolation levels are READ_COMMITTED and REPEATABLE_READ.
    <infinispan>
    	...
    	<default>
    	
    		<locking concurrencyLevel="${VALUE}"
    			 isolationLevel="${LEVEL}"/>
    Copy to Clipboard Toggle word wrap
  3. Specify Lock Acquisition Timeout

    The lockAcquisitionTimeout parameter specifies time (in milliseconds) after which a lock acquisition attempt times out.
    <infinispan>
    	...
    	<default>
    	
    		<locking concurrencyLevel="${VALUE}"
    			 isolationLevel="${LEVEL}"
    			 lockAcquisitionTimeout="${TIME}"/>
    Copy to Clipboard Toggle word wrap
  4. Configure Lock Striping

    The useLockStriping parameter specifies whether a pool of shared locks are maintained for all entries that require locks. If set to FALSE, locks are created for each entry in the cache. If set to TRUE, lock striping is enabled and shared locks are used as required from the pool.
    <infinispan>
    	...
    	<default>
    	
    		<locking concurrencyLevel="${VALUE}"
    			 isolationLevel="${LEVEL}"
    			 lockAcquisitionTimeout="${TIME}"
    			 useLockStriping="${TRUE/FALSE}"/>
    Copy to Clipboard Toggle word wrap
  5. Configure Write Skew Check

    The writeSkewCheck check determines if a modification to the entry from a different transaction should roll back the transaction. Write skew set to true requires isolation_level set to REPEATABLE_READ. The default value for writeSkewCheck and isolation_level are FALSE and READ_COMMITTED respectively.
    <infinispan>
    	...
    	<default>
    	
    		<locking concurrencyLevel="${VALUE}"
    			 isolationLevel="${LEVEL}"
    			 lockAcquisitionTimeout="${TIME}"
    			 useLockStriping="${TRUE/FALSE}"
    			 writeSkewCheck="${TRUE/FALSE}" />
    		...
    	
    	</default>
    </infinispan>
    Copy to Clipboard Toggle word wrap
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat