Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

LocalSessionFactoryObject Class

An IFactoryObject that creates a local Hibernate SessionFactory instance. Behaves like a SessionFactory instance when used as bean reference, e.g. for HibernateTemplate's "SessionFactory" property.

For a list of all members of this type, see LocalSessionFactoryObject Members .


[Visual Basic]
Public Class LocalSessionFactoryObject
    Implements IFactoryObject, IInitializingObject, IPersistenceExceptionTranslator, IDisposable, IApplicationContextAware
public class LocalSessionFactoryObject : IFactoryObject, IInitializingObject, IPersistenceExceptionTranslator, IDisposable, IApplicationContextAware

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.


The typical usage will be to register this as singleton factory in an application context and give objects references to application services that need it.

Hibernate configuration settings can be set using the IDictionary property 'HibernateProperties'.

This class implements the IPersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor for AOP-based translation of PersistenceExceptionTranslationPostProcessor. Hence, the presence of e.g. LocalSessionFactoryBean automatically enables a PersistenceExceptionTranslationPostProcessor to translate Hibernate exceptions.


Namespace: Spring.Data.NHibernate

Assembly: Spring.Data.NHibernate20 (in Spring.Data.NHibernate20.dll)

See Also

LocalSessionFactoryObject Members | Spring.Data.NHibernate Namespace