HHH-12268 : LazyInitializationException thrown from lazy collection when batch fetching enabled and owning entity refreshed with lock

HHH-12268 : Add imports back in because they are required for 5.3
This commit is contained in:
Gail Badner 2020-07-13 13:59:35 -07:00 committed by gbadner
parent d7af5ffbd6
commit bc0f109540
2 changed files with 6 additions and 3 deletions

View File

@ -143,6 +143,9 @@ public abstract class AbstractLoadPlanBasedEntityLoader extends AbstractLoadPlan
final QueryParameters qp = new QueryParameters();
qp.setPositionalParameterTypes( types );
qp.setPositionalParameterValues( ids );
qp.setOptionalObject( optionalObject );
qp.setOptionalEntityName( optionalEntityName );
qp.setOptionalId( optionalId );
qp.setLockOptions( lockOptions );
result = executeLoad(

View File

@ -230,9 +230,9 @@ public class EntityReferenceInitializerImpl implements EntityReferenceInitialize
// determine which entity instance to use. Either the supplied one, or instantiate one
Object entityInstance = null;
if ( isReturn &&
context.shouldUseOptionalEntityInformation() &&
context.getQueryParameters().getOptionalObject() != null ) {
// If an "optional" instance with an EntityKey equal to entityKey is available
// in the context, then use that instance.
if ( isReturn && context.getQueryParameters().getOptionalObject() != null ) {
final EntityKey optionalEntityKey = ResultSetProcessorHelper.getOptionalObjectKey(
context.getQueryParameters(),
context.getSession()