Skip to content

Commit 2225bd9

Browse files
Wojciech StelmaszewskiWojciech Stelmaszewski
authored andcommitted
Additional check if child session has already been closed during parent session closing.
1 parent 9efd3c3 commit 2225bd9

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)