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 {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,6 +101,11 @@ public abstract class AbstractCollectionInitializer implements CollectionInitial
|
|||
|
||||
if ( loadingEntry != null ) {
|
||||
collectionInstance = loadingEntry.getCollectionInstance();
|
||||
if ( collectionInstance.getOwner() == null ) {
|
||||
parentAccess.registerResolutionListener(
|
||||
owner -> collectionInstance.setOwner( owner )
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -108,6 +113,11 @@ public abstract class AbstractCollectionInitializer implements CollectionInitial
|
|||
|
||||
if ( existing != null ) {
|
||||
collectionInstance = existing;
|
||||
if ( collectionInstance.getOwner() == null ) {
|
||||
parentAccess.registerResolutionListener(
|
||||
owner -> collectionInstance.setOwner( owner )
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue