Open a ISession on the given connection, specifying an interceptor
Namespace:
NHibernateAssembly: NHibernate (in NHibernate.dll)
Syntax
Visual Basic (Declaration) |
---|
Function OpenSession ( _ conn As IDbConnection, _ interceptor As IInterceptor _ ) As ISession |
C# |
---|
ISession OpenSession( IDbConnection conn, IInterceptor interceptor ) |
Visual C++ |
---|
ISession^ OpenSession( IDbConnection^ conn, IInterceptor^ interceptor ) |
JavaScript |
---|
function openSession(conn, interceptor); |
Parameters
- conn
- Type: System.Data..::.IDbConnection
A connection provided by the application
- interceptor
- Type: NHibernate..::.IInterceptor
A session-scoped interceptor
Return Value
A session
Remarks
Note that the second-level cache will be disabled if you
supply a ADO.NET connection. NHibernate will not be able to track
any statements you might have executed in the same transaction.
Consider implementing your own IConnectionProvider.