1. Architecture
1.1. Overview
SessionFactory (org.hibernate.SessionFactory)
A thread-safe (and immutable) representation of the mapping of the application domain model to a database. Acts as a factory for
org.hibernate.Sessioninstances. TheEntityManagerFactoryis the JPA equivalent of aSessionFactoryand basically those two converge into the sameSessionFactoryimplementation.A
SessionFactoryis very expensive to create, so, for any given database, the application should have only one associatedSessionFactory. TheSessionFactorymaintains services that Hibernate uses across allSession(s)such as second level caches, connection pools, transaction system integrations, etc.线程安全
Hibernate ORM 5.1 User Guide
原文地址:http://www.cnblogs.com/rocker-pg/p/7685816.html