Obtains the current session.

Namespace: NHibernate
Assembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)

Syntax

C#
ISession GetCurrentSession()
Visual Basic
Function GetCurrentSession As ISession
Visual C++
ISession^ GetCurrentSession()

Return Value

The current session.

Remarks

The definition of what exactly "current" means is controlled by the ICurrentSessionContext implementation configured for use.

Exceptions

ExceptionCondition
NHibernate..::..HibernateExceptionIndicates an issue locating a suitable current session.

See Also