The connection was not being effectively closed due to
'NHibernate.ISession.Disconnect ()' contract:
//
// Summary:
// Disconnect the ISession from the current ADO.NET
connection.
//
// Returns:
// The connection provided by the application or null
//
// Remarks:
// If the connection was obtained by Hibernate, close it or
return it to the
// connection pool. Otherwise return it to the application.
This is used by
// applications which require long transactions.
This commit is contained in:
@@ -435,9 +435,13 @@ namespace Spring.Data.NHibernate.Support
|
||||
conversation.RootSessionPerConversation = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tmpSession.IsConnected)
|
||||
tmpSession.Disconnect();
|
||||
{
|
||||
if (tmpSession.IsConnected)
|
||||
{
|
||||
IDbConnection conn = tmpSession.Disconnect();
|
||||
if (conn != null && conn.State == ConnectionState.Open)
|
||||
conn.Close();
|
||||
}
|
||||
}
|
||||
RemoveSession(tmpSession);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user