HHH-9231 : Avoid updating collection 2LC if contains entity added in tx
This commit is contained in:
parent
36e35207f6
commit
4851ab01df
|
@ -352,11 +352,13 @@ public class CollectionLoadContext {
|
||||||
final CacheKey cacheKey = session.generateCacheKey( lce.getKey(), persister.getKeyType(), persister.getRole() );
|
final CacheKey cacheKey = session.generateCacheKey( lce.getKey(), persister.getKeyType(), persister.getRole() );
|
||||||
|
|
||||||
boolean isPutFromLoad = true;
|
boolean isPutFromLoad = true;
|
||||||
for (Serializable id : entry.getState()) {
|
if ( persister.getElementType().isAssociationType() ) {
|
||||||
EntityPersister entityPersister = ((QueryableCollection) persister).getElementPersister();
|
for ( Serializable id : entry.getState() ) {
|
||||||
if ( session.getPersistenceContext().wasInsertedDuringTransaction( entityPersister, id ) ) {
|
EntityPersister entityPersister = ( (QueryableCollection) persister ).getElementPersister();
|
||||||
isPutFromLoad = false;
|
if ( session.getPersistenceContext().wasInsertedDuringTransaction( entityPersister, id ) ) {
|
||||||
break;
|
isPutFromLoad = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue