Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

HibernateDaoSupport.Session Property

Get a Hibernate Session, either from the current transaction or a new one. The latter is only allowed if the "allowCreate" setting of this object's HibernateTemplate is true.

[Visual Basic]
Public ReadOnly Property Session() As ISession
   Public Get
   End Get
End Property
[C#]
public ISession Session { public get; }

Property Value

The Hibernate session.

Remarks

Note that this is not meant to be invoked from HibernateTemplate code but rather just in plain Hibernate code. Use it in combination with ReleaseSession.

In general, it is recommended to use HibernateTemplate, either with the provided convenience operations or with a custom HibernateCallback that provides you with a Session to work on. HibernateTemplate will care for all resource management and for proper exception conversion.

See Also

HibernateDaoSupport Class | Spring.Data.NHibernate.Support Namespace