AS7 string-keyed-jdbc-store configuration
bwallis42 Aug 21, 2012 8:15 AMI don't seem to be able to get my infinispan cache configuration working with a JDBC cache loader.
I'm running JDK 1.6.0_33 on Mac OSX 10.6 with JBoss AS 7.1.1.Final and Infinispan 5.1.2 as bundled with jboss.
A simple configuration I have tried is
{code}
<cache-container name="modeshapeCache" default-cache="default">
<local-cache name="testRepositoryCache">
<transaction mode="FULL_XA"/>
<string-keyed-jdbc-store datasource="java:jboss/datasources/JcrDataDS"/>
</local-cache>
</cache-container>
{code}
I have the following code in a stateless session bean
{code}
@Resource(name = "java:jboss/infinispan/container/modeshapeCache")
private EmbeddedCacheManager container;
...
this.cache = this.container.getCache("testRepositoryCache");
...
Configuration cacheConfiguration = this.cache.getCacheConfiguration();
log.info("Cache Configuration = "+cacheConfiguration);
TransactionManager txm = this.cache.getAdvancedCache().getTransactionManager();
log.info("Transaction Manager = "+txm);
{code}
Which outputs the following:
{code}
18:21:42,565 INFO [au.com.infomedix.jcrloadtest.jcrserver.restapi.TestCacheBean] (http-localhost-127.0.0.1-8080-1) Cache Configuration = Configuration{classLoader=ModuleClassLoader for Module "deployment.JcrServer.war:main" from Service Module Loader, clustering=ClusteringConfiguration{async=AsyncConfiguration{asyncMarshalling=false, replicationQueue=org.infinispan.remoting.ReplicationQueueImpl@532eb0b3, replicationQueueInterval=5000, replicationQueueMaxElements=1000, useReplicationQueue=false}, cacheMode=LOCAL, hash=HashConfiguration{activated=false, consistentHash=null, hash=org.infinispan.commons.hash.MurmurHash3@1e52e26f, numOwners=2, numVirtualNodes=48, groupsConfiguration=GroupsConfiguration{enabled=false, groupers=[]}, stateTransferConfiguration=StateTransferConfiguration{chunkSize=10000, fetchInMemoryState=false, originalFetchInMemoryState=false, timeout=240000}}, l1=L1Configuration{activated=true, enabled=false, invalidationThreshold=0, lifespan=600000, onRehash=false}, stateTransfer=StateTransferConfiguration{chunkSize=10000, fetchInMemoryState=false, originalFetchInMemoryState=false, timeout=240000}, sync=SyncConfiguration{replTimeout=15000}}, customInterceptors=CustomInterceptorsConfiguration{interceptors=[]}, dataContainer=DataContainerConfiguration{dataContainer=null}, deadlockDetection=DeadlockDetectionConfiguration{enabled=false, spinDuration=100}, eviction=EvictionConfiguration{maxEntries=-1, strategy=NONE, threadPolicy=DEFAULT}, expiration=ExpirationConfiguration{lifespan=-1, maxIdle=-1, reaperEnabled=true, wakeUpInterval=60000}, indexing=IndexingConfiguration{enabled=false, indexLocalOnly=false}, invocationBatching=InvocationBatchingConfiguration{enabled=false}, jmxStatistics=JMXStatisticsConfiguration{enabled=false}, loaders=LoadersConfiguration{cacheLoaders=[], passivation=false, preload=false, shared=false}, locking=LockingConfiguration{concurrencyLevel=32, isolationLevel=READ_COMMITTED, lockAcquisitionTimeout=10000, useLockStriping=false, writeSkewCheck=false}, storeAsBinary=StoreAsBinaryConfiguration{enabled=false, storeKeysAsBinary=true, storeValuesAsBinary=true}, transaction=TransactionConfiguration{autoCommit=true, cacheStopTimeout=30000, eagerLockingSingleNode=false, lockingMode=OPTIMISTIC, syncCommitPhase=true, syncRollbackPhase=false, transactionManagerLookup=org.infinispan.transaction.lookup.GenericTransactionManagerLookup@538ff4f6, transactionSynchronizationRegistryLookup=null, transactionMode=NON_TRANSACTIONAL, useEagerLocking=false, useSynchronization=false, recovery=RecoveryConfiguration{enabled=false, recoveryInfoCacheName='__recoveryInfoCacheName__'}, use1PcForAutoCommitTransactions=false}, versioning=VersioningConfiguration{enabled=false, scheme=NONE}, unsafe=UnsafeConfiguration{unreliableReturnValues=false}}
18:21:42,571 INFO [au.com.infomedix.jcrloadtest.jcrserver.restapi.TestCacheBean] (http-localhost-127.0.0.1-8080-1) Transaction Manager = null
{code}
If I remove the string-keyed-jdbc-store configuration then I get a non-null transaction manager.
The example given is a simplified version of attemtpting to use jdbc persistence of an infinispan cache for modeshape which is crashing with a null pointer exception when it attempts to use the transaction manager.
I haven't managed to find much documentation about how to configure this beyond what is in the XSD file jboss-as-infinispan_1_2.xsd.
Any help in getting this configured correctly would be most appreciated.