HHH-9231 : Avoid updating collection 2LC if contains entity added in tx
This commit is contained in:
parent
36e35207f6
commit
4851ab01df
|
@ -352,6 +352,7 @@ public class CollectionLoadContext {
|
|||
final CacheKey cacheKey = session.generateCacheKey( lce.getKey(), persister.getKeyType(), persister.getRole() );
|
||||
|
||||
boolean isPutFromLoad = true;
|
||||
if ( persister.getElementType().isAssociationType() ) {
|
||||
for ( Serializable id : entry.getState() ) {
|
||||
EntityPersister entityPersister = ( (QueryableCollection) persister ).getElementPersister();
|
||||
if ( session.getPersistenceContext().wasInsertedDuringTransaction( entityPersister, id ) ) {
|
||||
|
@ -359,6 +360,7 @@ public class CollectionLoadContext {
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CollectionRegionAccessStrategy has no update, so avoid putting uncommitted data via putFromLoad
|
||||
if (isPutFromLoad) {
|
||||
|
|
Loading…
Reference in New Issue