HHH-13790 Temporary session not being closed
This commit is contained in:
parent
27aff6eb01
commit
7780b74c21
|
@ -238,7 +238,7 @@ public abstract class AbstractPersistentCollection<E> implements Serializable, P
|
||||||
|
|
||||||
SharedSessionContractImplementor originalSession = null;
|
SharedSessionContractImplementor originalSession = null;
|
||||||
boolean isJTA = false;
|
boolean isJTA = false;
|
||||||
|
try {
|
||||||
if ( tempSession != null ) {
|
if ( tempSession != null ) {
|
||||||
isTempSession = true;
|
isTempSession = true;
|
||||||
originalSession = session;
|
originalSession = session;
|
||||||
|
@ -259,10 +259,9 @@ public abstract class AbstractPersistentCollection<E> implements Serializable, P
|
||||||
session.getSessionFactory()
|
session.getSessionFactory()
|
||||||
.getMappingMetamodel()
|
.getMappingMetamodel()
|
||||||
.getCollectionDescriptor( getRole() );
|
.getCollectionDescriptor( getRole() );
|
||||||
session.getPersistenceContextInternal().addUninitializedDetachedCollection( collectionDescriptor, this );
|
session.getPersistenceContextInternal()
|
||||||
|
.addUninitializedDetachedCollection( collectionDescriptor, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
return lazyInitializationWork.doWork();
|
return lazyInitializationWork.doWork();
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|
Loading…
Reference in New Issue