HHH-16155 Disable batching when generated properties are found
This commit is contained in:
parent
c3174e6b62
commit
4cc5941798
|
@ -54,10 +54,16 @@ public class InsertCoordinator extends AbstractMutationCoordinator {
|
||||||
public InsertCoordinator(AbstractEntityPersister entityPersister, SessionFactoryImplementor factory) {
|
public InsertCoordinator(AbstractEntityPersister entityPersister, SessionFactoryImplementor factory) {
|
||||||
super( entityPersister, factory );
|
super( entityPersister, factory );
|
||||||
|
|
||||||
insertBatchKey = new BasicBatchKey(
|
if ( entityPersister.hasInsertGeneratedProperties() ) {
|
||||||
entityPersister.getEntityName() + "#INSERT",
|
// disable batching in case of insert generated properties
|
||||||
null
|
insertBatchKey = null;
|
||||||
);
|
}
|
||||||
|
else {
|
||||||
|
insertBatchKey = new BasicBatchKey(
|
||||||
|
entityPersister.getEntityName() + "#INSERT",
|
||||||
|
null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if ( entityPersister.getEntityMetamodel().isDynamicInsert() ) {
|
if ( entityPersister.getEntityMetamodel().isDynamicInsert() ) {
|
||||||
// the entity specified dynamic-insert - skip generating the
|
// the entity specified dynamic-insert - skip generating the
|
||||||
|
|
|
@ -89,10 +89,16 @@ public class UpdateCoordinatorStandard extends AbstractMutationCoordinator imple
|
||||||
// there are cases where we need the full static updates.
|
// there are cases where we need the full static updates.
|
||||||
this.staticUpdateGroup = buildStaticUpdateGroup();
|
this.staticUpdateGroup = buildStaticUpdateGroup();
|
||||||
this.versionUpdateGroup = buildVersionUpdateGroup();
|
this.versionUpdateGroup = buildVersionUpdateGroup();
|
||||||
this.batchKey = new BasicBatchKey(
|
if ( entityPersister.hasUpdateGeneratedProperties() ) {
|
||||||
entityPersister.getEntityName() + "#UPDATE",
|
// disable batching in case of update generated properties
|
||||||
null
|
this.batchKey = null;
|
||||||
);
|
}
|
||||||
|
else {
|
||||||
|
this.batchKey = new BasicBatchKey(
|
||||||
|
entityPersister.getEntityName() + "#UPDATE",
|
||||||
|
null
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue