Can a Infinispan Cache Store get out of sync with the Cache when using Transactions?
ma6rl Jan 24, 2015 11:29 AMI have asked this question over on the Infinispan forum and Stackoverflow
https://developer.jboss.org/message/916877#916877
but was hoping you guys might have some answers given that Infinispan is the persistence tier in Modeshape.
I'm using Modeshape 4.0 with Wildfly 8.2 and have created a transactional cache that is used by ModeShape and backed by a JDBC cache store:
<transport lock-timeout="60000"/> <replicated-cache name="repo" mode="SYNC"> <transaction mode="NON_XA" locking="PESSIMISTIC"/> <locking isolation="READ_COMMITTED" striping="false"/> <string-keyed-jdbc-store shared="true" preload="false" passivation="false" purge="false" datasource="java:jboss/datasources/MyDS"> <string-keyed-table prefix="modeshape"> <id-column name="id" type="VARCHAR(200)"/> <data-column name="datum" type="LONGBLOB"/> <timestamp-column name="version" type="BIGINT"/> </string-keyed-table> </string-keyed-jdbc-store> </replicated-cache> </cache-container>
My concern is that after reading the Infinispan documentation
4.5. Cache Loaders and transactional caches
When a cache is transactional and a cache loader is present, the cache loader won’t be enlisted in the transaction in which the cache is part. That means that it is possible to have inconsistencies at cache loader level: the transaction to succeed applying the in-memory state but (partially) fail applying the changes to the store. Manual recovery would not work with caches stores.
that there is no guarantee that just because a transaction commits/rolls-back in the cache that the cache store is also committed/rolled back correctly. Give that Modeshape typically updates/creates multiple cache entries when adding/removing nodes is there not a chance that over time the cache and cache store may become out of sync. if this is the case that seems to imply there is no guaranteed way to ensure that all nodes created in Modeshape and stored in infinispan will survive application restarts.
Any information you can provide on this will be most appreciated.