HHH-18632 Concurrency issue with AbstractEntityPersister#nonLazyPropertyLoadPlansByName
This commit is contained in:
parent
4fbc8f96ef
commit
0cea4d345f
|
@ -464,7 +464,7 @@ public abstract class AbstractEntityPersister
|
|||
private final boolean implementsLifecycle;
|
||||
|
||||
private List<UniqueKeyEntry> uniqueKeyEntries = null; //lazily initialized
|
||||
private HashMap<String,SingleIdArrayLoadPlan> nonLazyPropertyLoadPlansByName;
|
||||
private ConcurrentHashMap<String,SingleIdArrayLoadPlan> nonLazyPropertyLoadPlansByName;
|
||||
|
||||
public AbstractEntityPersister(
|
||||
final PersistentClass persistentClass,
|
||||
|
@ -1552,17 +1552,17 @@ public abstract class AbstractEntityPersister
|
|||
int propertyIndex = getPropertyIndex( fieldName );
|
||||
partsToSelect.add( getAttributeMapping( propertyIndex ) );
|
||||
SingleIdArrayLoadPlan lazyLoanPlan;
|
||||
if ( nonLazyPropertyLoadPlansByName == null ) {
|
||||
nonLazyPropertyLoadPlansByName = new HashMap<>();
|
||||
ConcurrentHashMap<String, SingleIdArrayLoadPlan> propertyLoadPlansByName = this.nonLazyPropertyLoadPlansByName;
|
||||
if ( propertyLoadPlansByName == null ) {
|
||||
propertyLoadPlansByName = new ConcurrentHashMap<>();
|
||||
lazyLoanPlan = createLazyLoanPlan( partsToSelect );
|
||||
;
|
||||
nonLazyPropertyLoadPlansByName.put( fieldName, lazyLoanPlan );
|
||||
propertyLoadPlansByName.put( fieldName, lazyLoanPlan );
|
||||
this.nonLazyPropertyLoadPlansByName = propertyLoadPlansByName;
|
||||
}
|
||||
else {
|
||||
lazyLoanPlan = nonLazyPropertyLoadPlansByName.get( fieldName );
|
||||
if ( lazyLoanPlan == null ) {
|
||||
lazyLoanPlan = createLazyLoanPlan( partsToSelect );
|
||||
;
|
||||
nonLazyPropertyLoadPlansByName.put( fieldName, lazyLoanPlan );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue