In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to use Hibernate 3 L2 cache, Xiaobian thinks it is quite practical, so share it with you as a reference, I hope you can gain something after reading this article.
1. Hibernate3's L2 cache, like session-level cache, only caches entity objects, not attribute-level queries; the L2 cache's life cycle is the same as sessionFactory's life cycle, sessionFactory can manage L2 cache;
2. SessionFactory level cache, need to be manually configured; all sessions can share sessionFactory level cache;(generally put some infrequently changing entity objects into sessionFactory level cache, suitable for putting infrequently changing entity objects).
3.Hiberante3 L2 cache configuration and usage methods are as follows:
You must import the ehcache.jar package, and then copy ehcache.xml to the project src directory under Hibernate3.2 etc file (there are detailed English instructions in the parameters in ehcache.xml);
Description: ehcache.jar is a third-party cache product, hiberante only integrates it, and there are many third-party hibernate integrated cache products, please refer to hiberante3 development manual for relevant instructions;ehcache does not support distributed applications, if there are distributed requirements, please switch to support distributed secondary cache products, hiberate3 development manual has phase header instructions. The configuration methods are similar);
4. Hibernate3's L2 cache is on by default, or you can specify on. Configure the following in hibernate.cfg.xml:
* Modify hibernate.cfg.xml file to open secondary cache;
true
* Specify the provider of the secondary cache product;
org.hibernate.cache.EhCacheProvider
For those entities to use the L2 cache, add to the hibernate.cfg.xml configuration file:
--> About "How to use Hibernate 3 L2 cache" This article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.