Obtains the current session.
Namespace:
NHibernateAssembly: NHibernate (in NHibernate.dll)
Syntax
Visual Basic (Declaration) |
---|
Function GetCurrentSession As ISession |
C# |
---|
ISession GetCurrentSession() |
Visual C++ |
---|
ISession^ GetCurrentSession() |
JavaScript |
---|
function 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. |