In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces what Hibernate SessionFactory is, the article is very detailed, has a certain reference value, interested friends must read it!
SessionFactory (org.hibernate.SessionFactory) contains compiled maps (mappings), is the factory where session is made, and may contain some data that can be shared between transactions (transaction)
(1) SessionFactory cache
It can be divided into two categories: built-in cache and external cache. SessionFactory's built-in cache stores Hibernate configuration information and mapping metadata information, as well as SQL statements automatically generated by Hibernate. SessionFactory's external cache is a configurable cache plug-in, which is not enabled by SessionFactory by default. External cache
It can store a large number of copies of database data, and the physical media of external cache can be memory or hard disk.
(2) there is only one data storage source, so you only need to create a SessionFactory. SessionFactory is a heavyweight object, and if the application has only one data source, you only need to create a Hibernate SessionFactory instance, because randomly creating an Hibernate SessionFactory instance will take up a lot of memory space. But when your project is working on multiple databases, you must specify a SessionFactory for each database.
(3) other uses of Configuration
The configure () method of Configuration also supports access with parameters. You can specify the location of the hbm.xml file instead of using the default classpath.
The following hibernate.cfg.xml approach, for example:
Configuration cfg = new Configuration (). Configure ("myexample.xml"); above is all the content of the article "what is Hibernate SessionFactory?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.