Saturday, 15 May 2010

java - 2nd level hibernate cache understanding -


** 1 ** For second-level caches, can only set the timeout period but can not clear the refresh / unit cache? Or is auto-refresh / cache saving / updating / mergeupdate every time as the tipping annotation @Cache (use = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) ? Is hibernated template. Flush () related to this?


2. Is it good for all institutions to enable second level cache?

= "text">

1) If you have to do then you can manually remove the bodies from the second level cache. There are several ways for this purpose; Some ejected a single instance of a unit (or collection); Others ejected all bodies of the given class (or name of the given entity).

He said, you should not do this like Normally - Hibernate will keep the cache updated for you (as long as you are not updating something like that SQL Update - in which case your question is clear).

2) Generally - no, it is not good for cash All Organizations This is usually a good idea to cache an inevitable institution, as well as Are often loaded / rarely updated; Suppose you do not have tons of them. But again, it really depends on you what you are doing.

There is a timeout (or, if you make a safe), your cache size / good caching strategy should not be trusted.


No comments:

Post a Comment