HHH-15453 java.lang.NullPointerException: Cannot invoke org.hibernate.engine.spi.EntityEntry.getEntityKey() because ownerEntry is null
This commit is contained in:
parent
ed4f399723
commit
d862b086ea
|
@ -282,7 +282,11 @@ public abstract class AbstractPersistentCollection<E> implements Serializable, P
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( !session.isTransactionInProgress() ) {
|
/*
|
||||||
|
Whenever the collection lazy loading is triggered during the loading process,
|
||||||
|
closing the connection will cause an error when RowProcessingStateStandardImpl#next() will be called.
|
||||||
|
*/
|
||||||
|
if ( !session.isTransactionInProgress() && session.getPersistenceContext().isLoadFinished() ) {
|
||||||
session.getJdbcCoordinator().afterTransaction();
|
session.getJdbcCoordinator().afterTransaction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,11 @@ public abstract class AbstractCollectionInitializer implements CollectionInitial
|
||||||
|
|
||||||
if ( loadingEntry != null ) {
|
if ( loadingEntry != null ) {
|
||||||
collectionInstance = loadingEntry.getCollectionInstance();
|
collectionInstance = loadingEntry.getCollectionInstance();
|
||||||
|
if ( collectionInstance.getOwner() == null ) {
|
||||||
|
parentAccess.registerResolutionListener(
|
||||||
|
owner -> collectionInstance.setOwner( owner )
|
||||||
|
);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,6 +113,11 @@ public abstract class AbstractCollectionInitializer implements CollectionInitial
|
||||||
|
|
||||||
if ( existing != null ) {
|
if ( existing != null ) {
|
||||||
collectionInstance = existing;
|
collectionInstance = existing;
|
||||||
|
if ( collectionInstance.getOwner() == null ) {
|
||||||
|
parentAccess.registerResolutionListener(
|
||||||
|
owner -> collectionInstance.setOwner( owner )
|
||||||
|
);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue