NHibernate Forge
The official new home for the NHibernate for .NET community

Obtaining an ISessionFactory

Article
Comments (0)
History (3)

Obtaining an ISessionFactory

When all mappings have been parsed by the Configuration, the application must obtain a factory for ISession instances. This factory is intended to be shared by all application threads:

ISessionFactory sessions = cfg.BuildSessionFactory();

However, NHibernate does allow your application to instantiate more than one ISessionFactory.

This is useful if you are using more than one database.

Recent Comments

Leave the first comment for this page.
View All
Powered by Community Server (Commercial Edition), by Telligent Systems