12.4.2.3. JdbcBinaryCacheStore Configuration (Library Mode)


The following is a sample configuration for the JdbcBinaryCacheStore:
<loaders>
	<binaryKeyedJdbcStore xmlns="urn:infinispan:config:jdbc:5.2" 
			      fetchPersistentState="false"
			      ignoreModifications="false" 
			      purgeOnStartup="false">
		<connectionPool connectionUrl="jdbc:h2:mem:infinispan_binary_based;DB_CLOSE_DELAY=-1" 
				username="sa" 
				driverClass="org.h2.Driver"/>
		<binaryKeyedTable dropOnExit="true" 
				  createOnStart="true" 
				  prefix="ISPN_BUCKET_TABLE">
			<idColumn name="ID_COLUMN" 
				  type="VARCHAR(255)" />
			<dataColumn name="DATA_COLUMN" 
				    type="BINARY" />
			<timestampColumn name="TIMESTAMP_COLUMN" 
					 type="BIGINT" />
		</binaryKeyedTable>
	</binaryKeyedJdbcStore>
</loaders>
Copy to Clipboard Toggle word wrap
The binaryKeyedJdbcStore Element

The binaryKeyedJdbcStore element uses the following parameters to configure the cache store:

  • The fetchPersistentState parameter determines whether the persistent state is fetched when joining a cluster. Set this to true if using a replication and invalidation in a clustered environment. Additionally, if multiple cache stores are chained, only one cache store can have this propety enabled. If a shared cache store is used, the cache does not allow a persistent state transfer despite this property being set to true.
  • The ignoreModifications parameter determines whether operations that modify the cache (e.g. put, remove, clear, store, etc.) do not affect the cache. As a result, the cache store can become out of sync with the cache.
  • The purgeOnStartup parameter specifies whether the cache is purged when initally started.
The connectionPool Element

The connectionPool element specifies a connection pool for the JDBC drive using the following parameters:

  • The connectionUrl parameter specifies the JDBC driver-specfic connection URL.
  • The username parameter contains the username used to connect via the connectionUrl.
  • The driverClass parameter specifies the class name of the driver used to connect to the database.
The binaryKeyedTable Element

Add the binaryKeyedTable element defines the table that stores cache entries. It uses the following parameters to configure the cache store:

  • The dropOnExit parameter specifies whether the database tables are dropped upon shutdown.
  • The createOnStart parameter specifies whether the database tables are created by the store on startup.
  • The prefix parameter defines the string prepended to name of the target cache when composing the name of the cache bucket table.
The idColumn Element

The idColumn element defines the column where the cache key or bucket ID is stored. It used the following parameters:

  • Use the name parameter to specify the name of the column used.
  • Use the type parameter to specify the type of the column used.
The dataColumn Element

The dataColumn element specifies the column where the cache entry or bucket is stored.

  • Use the name parameter to specify the name of the column used.
  • Use the type parameter to specify the type of the column used.
The timestampColumn Element

The timestampColumn element specifies the column where the time stamp of the cache entry or bucket is stored.

  • Use the name parameter to specify the name of the column used.
  • Use the type parameter to specify the type of the column used.
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

© 2025 Red Hat