What happens when one instance of Hibernate cannot get into the second level cache?

Suppose I have two services, each of which launches the same Hibernate application, using the same second level cache. Now suppose that one of the services cannot connect to the level 2 cache (someone has set a firewall rule that prevents access to the cache cluster). How does this server work after that? How is data consistency between servers?

+6
source share
2 answers

An experiment is called. But I would argue that you get an immediate exception to the Hibernate operation, which suffered a communication failure, not very different from what would happen if the database is unavailable.

+1
source

Practice should be such as to handle the exception and could not get it from the cache, then it should go to the database and get the values.

+1
source

All Articles