Obtains the current session.
Namespace: NHibernate
Assembly: NHibernate (in NHibernate)
Version: 1.2.0.4000
Syntax
| Visual Basic (Declaration) |
|---|
Function GetCurrentSession As ISession |
| C# |
|---|
ISession GetCurrentSession () |
| 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
| Exception | Condition |
|---|---|
| NHibernate.HibernateException | Indicates an issue locating a suitable current session. |