Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens when one Hibernate instance can't reach the second level cache?

Tags:

java

hibernate

Suppose I have two serves, each running the same Hibernate application using the same 2nd level cache. Now suppose one of the serves can't connect to the 2nd level cache (someone put up a firewall rule that prevents the access to the cache cluster). How does that server work afterwards? How is data consistency kept between the servers?

like image 250
Oded Peer Avatar asked Dec 27 '12 12:12

Oded Peer


2 Answers

Experimentation is called for. But I would bet what you get is an immediate exception from the Hibernate operation that suffered the communications failure, not very different from what would occur if the DB is unavailable.

like image 58
David W Avatar answered Oct 31 '22 00:10

David W


Practice should be in such way that, to handle the exception and could not get it from cache then must hit to database and get the values.

like image 41
Manoj Kathiriya Avatar answered Oct 30 '22 22:10

Manoj Kathiriya