Open a ISession on the given connection
Namespace:
NHibernateAssembly: NHibernate (in NHibernate.dll)
Syntax
Visual Basic (Declaration) |
---|
Function OpenSession ( _ conn As IDbConnection _ ) As ISession |
C# |
---|
ISession OpenSession( IDbConnection conn ) |
Visual C++ |
---|
ISession^ OpenSession( IDbConnection^ conn ) |
JavaScript |
---|
function openSession(conn); |
Parameters
- conn
- Type: System.Data..::.IDbConnection
A connection provided by the application
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.