Is it possible to limit the size of Hibernate second-level-cache for a specific entity? -


i have scenario hibernate second-level-cache enabled , i'd cache entity 1000 instances created every day , retained 8 years queries deal recent 2 days. avoid having create history table because rare cases historical lookup, code dependent on date.

is possible in hibernate, infinispan level-2 provider, configure specifically, particular cache specific attributes (eviction policy, size, etc.) hibernate should use entity foo?

yes. in hibernate, can have n cache "regions", can have different configurations , can specific entities. configuration dependent on provider (infinispan, in case). see document more details on infinispan configuration:

http://community.jboss.org/wiki/usinginfinispanasjpahibernatesecondlevelcacheprovider#advanced_configuration

look @ examples on how override defaults entity/collection. there, can set eviction strategy, lifespan , number of entities keep in cache.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -