이 콘텐츠는 선택한 언어로 제공되지 않습니다.
3.2. Obtaining a SessionFactory
When all mappings have been parsed by the
org.hibernate.cfg.Configuration
, the application must obtain a factory for org.hibernate.Session
instances. This factory is intended to be shared by all application threads:
SessionFactory sessions = cfg.buildSessionFactory();
SessionFactory sessions = cfg.buildSessionFactory();
Hibernate does allow your application to instantiate more than one
org.hibernate.SessionFactory
. This is useful if you are using more than one database.