Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

15.2. JdbcStringBasedStores


The JdbcStringBasedStore stores each entry in its own row in the table, instead of grouping multiple entries into each row, resulting in increased throughput under a concurrent load. It also uses a (pluggable) bijection that maps each key to a String object. The Key2StringMapper interface defines the bijection.
Red Hat JBoss Data Grid includes a default implementation called DefaultTwoWayKey2StringMapper that handles primitive types.

15.2.1. JdbcStringBasedStore Configuration (Remote Client-Server Mode)

The following is a sample JdbcStringBasedStore for Red Hat JBoss Data Grid's Remote Client-Server mode with Passivation enabled.

Procedure 15.4. Configure JdbcStringBasedStore in Remote Client-Server Mode

  1. The string-keyed-jdbc-store Element

    The string-keyed-jdbc-store element specifies the configuration for a string based keyed cache JDBC store.
    1. The datasource parameter defines the name of a JNDI for the datasource.
    2. The passivation parameter determines whether entries in the cache are passivated (true) or if the cache store retains a copy of the contents in memory (false).
    3. The preload parameter specifies whether to load entries into the cache during start up. Valid values for this parameter are true and false.
    4. The purge parameter specifies whether or not the cache store is purged when it is started. Valid values for this parameter are true and false.
    5. The shared parameter is used when multiple cache instances share a cache store. This parameter can be set to prevent multiple cache instances writing the same modification multiple times. Valid values for this parameter are true and false.
    6. The singleton parameter enables a singleton store cache store. SingletonStore is a delegating cache store used when only one instance in a cluster can interact with the underlying store.
    <local-cache> 
    	...
    	<string-keyed-jdbc-store datasource="java:jboss/datasources/JdbcDS" 
    				 passivation="true" 
    				 preload="false" 
    				 purge="false"
    				 shared="false"
    				 singleton="true">
    
    Copy to Clipboard Toggle word wrap
  2. The string-keyed-table Element

    The string-keyed-table element specifies information about the database table used to store string based cache entries.
    1. The prefix parameter specifies a prefix string for the database table name.
    <local-cache> 
    	...
    	<string-keyed-jdbc-store datasource="java:jboss/datasources/JdbcDS" 
    				 passivation="true" 
    				 preload="false" 
    				 purge="false"
    				 shared="false"
    				 singleton="true">
                   	<string-keyed-table prefix="JDG">
    
    Copy to Clipboard Toggle word wrap
  3. The id-column Element

    The id-column element specifies information about a database column that holds cache entry IDs.
    1. The name parameter specifies the name of the ID column.
    2. The type parameter specifies the type of the ID column.
    <local-cache> 
    	...
    	<string-keyed-jdbc-store datasource="java:jboss/datasources/JdbcDS" 
    				 passivation="true" 
    				 preload="false" 
    				 purge="false"
    				 shared="false"
    				 singleton="true">
                   	<string-keyed-table prefix="JDG">
                   		<id-column name="id" 
    				   type="${id.column.type}"/>
    
    Copy to Clipboard Toggle word wrap
  4. The data-column Element

    The data-column element contains information about a database column that holds cache entry data.
    1. The name parameter specifies the name of the database column.
    2. The type parameter specifies the type of the database column.
    <local-cache> 
    	...
    	<string-keyed-jdbc-store datasource="java:jboss/datasources/JdbcDS" 
    				 passivation="true" 
    				 preload="false" 
    				 purge="false"
    				 shared="false"
    				 singleton="true">
                   	<string-keyed-table prefix="JDG">
                   		<id-column name="id" 
    				   type="${id.column.type}"/>
    			<data-column name="datum" 
    				     type="${data.column.type}"/>
    
    Copy to Clipboard Toggle word wrap
  5. The timestamp-column Element

    The timestamp-column element specifies information about the database column that holds cache entry timestamps.
    1. The name parameter specifies the name of the database column.
    2. The type parameter specifies the type of the database column.
    <local-cache> 
    	...
    	<string-keyed-jdbc-store datasource="java:jboss/datasources/JdbcDS" 
    				 passivation="true" 
    				 preload="false" 
    				 purge="false"
    				 shared="false"
    				 singleton="true">
                   	<string-keyed-table prefix="JDG">
                   		<id-column name="id" 
    				   type="${id.column.type}"/>
    			<data-column name="datum" 
    				     type="${data.column.type}"/>
    			<timestamp-column name="version" 
    					  type="${timestamp.column.type}"/>
    	        </string-keyed-table>
    	</string-keyed-jdbc-store>
    </local-cache>
    
    Copy to Clipboard Toggle word wrap
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat