Hi all,
I am working on adding clustering-support to our application, which is using osCache as the cache provider, and after reading the on-line docs, Hibernate in Action and searching the forum, I am still somewhat unclear about something. According to the documentation, read-write is not applicable when deployed in a cluster. On the other hand, nonstrict read-write evicts an entity from the cache upon update, and the osCache eventListener broadcasts this across the cluster, which seems exactly what I need. However this is what "Hibernate in Action" has to say about it:
Quote:
nonstrict-read-write—Makes no guarantee of consistency between the cache
and the database. If there is a possibility of concurrent access to the same
entity, you should configure a sufficiently short expiry timeout. Otherwise,
you may read stale data in the cache. Use this strategy if data rarely changes
(many hours, days or even a week) and a small likelihood of stale data isn’t
of critical concern. Hibernate invalidates the cached element if a modified
object is flushed, but this is an asynchronous operation, without any cache
locking or guarantee that the retrieved data is the latest version.
Could anyone provide an example for a scenario in which stale-data would be retrieved from the cache?
Is nonstrict-read-write suitable for implementing cache in a cluster?
Thanks,
Naaman