Open a ISession on the given connection, specifying an interceptor

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

Syntax

C#
ISession OpenSession(
	IDbConnection conn,
	IInterceptor sessionLocalInterceptor
)
Visual Basic
Function OpenSession ( _
	conn As IDbConnection, _
	sessionLocalInterceptor As IInterceptor _
) As ISession
Visual C++
ISession^ OpenSession(
	IDbConnection^ conn, 
	IInterceptor^ sessionLocalInterceptor
)

Parameters

conn
Type: System.Data..::..IDbConnection
A connection provided by the application
sessionLocalInterceptor
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.

See Also