How can I make a one transaction with two named caches?
verystrongjoe Mar 6, 2013 11:34 AMHi, I have a lot of interested in Infinispan and am happy for joining here.
This is my first time when i write here. please help me
The software that I want to make using infinispan is like FIFO queue with failover.
So, it is not only in-memory-database, but also trigger business process with entry out from deque.
and the nodes has 4 and each node has two named cache. One cache, pilotCache, is real data cache saving (Key, Value) type objects and
the other cache, ketSetCache, is for saving key, (Key, name of node where data of the key exists).
And keySetCache is used when one of node is fail and the data have to be triggered again)
<default> | |||
<transaction | |||
transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" | |||
lockingMode="OPTIMISTIC"> | |||
</transaction> | |||
</default> | |||
<namedCache name="keySetCache"> | |||
<clustering mode="repl"/> | |||
<jmxStatistics enabled="true"/> | |||
</namedCache> |
<namedCache name="pilotCache"> | |||
<clustering mode="dist"> | |||
<sync replTimeout="20000" /> | |||
<hash numOwners="1" /> | |||
</clustering> | |||
<storeAsBinary enabled="true" storeKeysAsBinary="true" /> |
<loaders passivation="false" shared="true" preload="true"> | ||
<loader class="org.infinispan.loaders.jdbc.binary.JdbcBinaryCacheStore" fetchPersistentState="false" |
ignoreModifications="false" purgeOnStartup="false">
<properties>
<property name="bucketTableNamePrefix" value="ISPN_BUCKET_TABLE"/>
<property name="idColumnName" value="ID_COLUMN"/>
<property name="dataColumnName" value="DATA_COLUMN"/>
<property name="timestampColumnName" value="TIMESTAMP_COLUMN"/>
<property name="idColumnType" value="VARCHAR(255)"/>
<property name="dataColumnType" value="BINARY"/>
<property name="timestampColumnType" value="BIGINT"/>
<property name="connectionFactoryClass" value="org.infinispan.loaders.jdbc.connectionfactory.SimpleConnectionFactory"/>
<property name="connectionUrl" value="jdbc:h2:tcp://localhost:4444/dbFile/cosmos;MODE=Oracle;DB_CLOSE_DELAY=-1"/>
<property name="userName" value="sa"/>
<property name="password" value="sa"/>
<property name="driverClass" value="org.h2.Driver"/>
<property name="dropTableOnExit" value="false"/>
<property name="createTableOnStart" value="true"/>
</properties>
</loader>
</loaders> | ||
</namedCache> |
1) I want to make two caches be in one transaction, but the configuration xml in infinispan have to set one transaction each cache.
detaily, i have to guarantee that one entry have to enter two caches.
2) If I set listener that sync is false and add one entry, then the entryCreatedEvent is invoked, and it failed..
but I don't want to rollback. How can I configure for that?