Reputation: 490
Dear Infinispan community
I run application in EAP and Spring deployment. After migrating dependencies from EAP 7.1 to EAP 7.2 I get warning in spring mode: HHH025030: Transactional caches are not supported. The configuration option will be ignored; please unset
when using transaction tag in infinispan.xml - same applies in local-cache-configuration or invalidation-cache-configuration
<local-cache-configuration name="my-region">
<transaction mode="NON_DURABLE_XA" transaction-manager-lookup="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup"/>
<expiration ... />
<memory>
<object size="..." strategy="LRU" />
</memory>
</local-cache-configuration>
<!-- OR -->
<invalidation-cache-configuration name="my-region">
<locking concurrency-level="32" acquire-timeout="15000"/>
<transaction mode="NON_DURABLE_XA" transaction-manager-lookup="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup"/>
<expiration ... />
<memory>
<object size="..." strategy="LRU" />
</memory>
</invalidation-cache-configuration>
I found ticket saying that EAP should remove transaction tag but without explanation why.
The closest explanation I found is in the comment for pull request infinispan!5900 which says v53 drops support for transactional caches completely.
but documentation for Hibernate 5.3.20.Final or 5.4.28.Final doesn't mention anything related and still lists transactional concurrency strategy.
What is the impact in hibernate 2LC that Infinispan configuration does not support transaction tag?
My usecase cares if 2LC cache for entity get invalidated after row was committed into DB (to behave like SQL query with transaction level read-committed). If transaction T1 updates entity in version V1 to V2 then transaction T2 should keep using entity V1 until transaction T1 commits in DB. If transaction T1 rollbacks then triggering cache invalidation is still fine for me as I don't use replicated cache, but invalidation-cache.
I use entity with annotation org.hibernate.annotations.Cache(region = "my-region", usage = CacheConcurrencyStrategy.TRANSACTIONAL)
.
Which concurrency strategy should I use in that case and how to configure Infinispan cache?
Does CacheConcurrencyStrategy.TRANSACTIONAL strategy use XA Resource to clean the cache after row was committed into DB.
Is there documentation or tests how Infinispan behaves in such edge cases with hibernate 2LC?
Versions: EAP 7.2 / Spring 5.x - hibernate-core:5.3.15.Final-redhat-00001, infinispan-hibernate-cache-v53:9.3.8.Final-redhat-00001
Upvotes: 2
Views: 937
Reputation: 1344
I'm not familiar with Hibernate 2LC integration. Infinispan documentation says (you have the full context in the link):
Infinispan provides the same consistency guarantees for both transactional and read-write strategies, use of transactions is considered an implementation detail.
Does it help you?
Upvotes: 1