Merge pull request #122 from hailtondecastro/master

The connection was not being effectively closed due to needing to disconnect first
This commit is contained in:
Steve Bohlen
2015-11-22 13:12:20 -05:00

View File

@@ -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);
}