Skip to content

Commit fd377d8

Browse files
committed
NHE-161 Fixing by rolling back to behavior < v5.
1 parent 44fd081 commit fd377d8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Src/NHibernate.Envers/Tools/Toolz.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@ public static object GetTargetFromProxy(ISessionImplementor session, INHibernate
3434
var lazyInitializer = proxy.HibernateLazyInitializer;
3535
var proxySession = (ISession)lazyInitializer.Session;
3636

37-
using (var tempSession = proxySession == null
37+
var tempSession = proxySession == null
3838
? CreateChildSession((ISession) session)
39-
: CreateChildSession(proxySession))
40-
{
41-
return tempSession.Get(lazyInitializer.EntityName, lazyInitializer.Identifier);
42-
}
39+
: CreateChildSession(proxySession);
40+
return tempSession.Get(lazyInitializer.EntityName, lazyInitializer.Identifier);
4341
}
4442

4543
public static bool ObjectsEqual(object obj1, object obj2)
@@ -98,7 +96,7 @@ public static bool ArraysEqual(object[] array1, object[] array2)
9896

9997
public static ISession CreateChildSession(ISession session)
10098
{
101-
return session.SessionWithOptions().Connection().Interceptor().OpenSession();
99+
return session.SessionWithOptions().Connection().ConnectionReleaseMode().FlushMode().Interceptor().OpenSession();
102100
}
103101
}
104102
}

0 commit comments

Comments
 (0)