Monday, July 2, 2012

Hibernate: Cache Invalidation Between 2 Separate Apps

Assuming the scenario where you have an admin server managing the database entries and an app server servicing user requests, and the app server is using EHCache for caching, it is possible for the Hibernate/EHCache instances to send cache invalidation messages to each other. This is a particularly useful setup as the entities in the app server might be best configured as "read-only" while the same entity in the admin server might be configured as "read-write".

For the admin server to successfully invalidate the cache on the app servers, just configure both apps to be part of the same JGroups cluster, and take note of the following issue here, and it should work fine. The classes on both ends have to be compatible of course,

No comments:

Post a Comment