SessionFactory in Hibernate

By: Felix  

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();

Hibernate does allow your application to instantiate more than one org.hibernate.SessionFactory. This is useful if you are using more than one database.




Archived Comments

1. Brettkip
View Tutorial          By: Brettkip at 2017-06-02 01:45:52

2. good one may i know which one is good way to get sessionFactory
View Tutorial          By: m.ravindra at 2012-04-15 17:01:17


Most Viewed Articles (in Hibernate )

Latest Articles (in Hibernate)

Comment on this tutorial