Hibernation L2 transactional cache

Q1: What does a "transactional" strategy guarantee?

Q2: What is the difference between "transactional" strategy and the strategy of "read / write" with JTA as transaction manager (determined by the property).

Q3: What if I specify the transaction strategy for some object in the .hbm.xml file and then use the L2 cache that does not support the transaction strategy.

+2


source to share


1 answer


For Q1 - Transaction means two things in my understanding. If you have synchronous replication, the transaction is suspended until all nodes have received the replicated change. if you have asynchronous replication, you can be sure that your other nodes will see changes to the selected isolation level (for example, read) and comply with the commitments and rollback. This also means that if there is an error in the database, or another exception (causing a rollback in the case of the transactional aspect for the caller), the cache will also rollback - keeping the cache in sync with the database. note that this requires a JPA transaction manager.

For Q2 - Read / Write is not cluster safe, it does not guarantee data consistency between nodes



For Q3 - never tried it, but most likely it will work with a nice exception

+2


source







All Articles