In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.