Google News
logo
Java Hibernates - Interview Questions
What are concurrency strategies?
A concurrency strategy is a mediator which responsible for storing items of data in the cache and retrieving them from the cache. If you are going to enable a second-level cache, you will have to decide, for each persistent class and collection, which cache concurrency strategy to use.
 
Transactional : Use this strategy for read-mostly data where it is critical to prevent stale data in concurrent transactions,in the rare case of an update.
 
Read-write : Again use this strategy for read-mostly data where it is critical to prevent stale data in concurrent transactions,in the rare case of an update.
 
Nonstrict-read-write : This strategy makes no guarantee of consistency between the cache and the database. Use this strategy if data hardly ever changes and a small likelihood of stale data is not of critical concern.
 
Read-only : A concurrency strategy suitable for data which never changes. Use it for reference data only.
Advertisement