Skip to content

Commit 36100cc

Browse files
authored
Merge pull request #542 from itmagination/simple_check_if_child_session_has_already_been_closed
Additional check if child session has already been closed during parent session closing.
2 parents 8671389 + 2225bd9 commit 36100cc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/NHibernate/Impl/SessionImpl.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,10 @@ public IDbConnection Close()
370370
{
371371
foreach (KeyValuePair<EntityMode, ISession> pair in childSessionsByEntityMode)
372372
{
373-
pair.Value.Close();
373+
if (pair.Value.IsOpen)
374+
{
375+
pair.Value.Close();
376+
}
374377
}
375378
}
376379
}

0 commit comments

Comments
 (0)