HHH-14903 The new getConfiguredJdbcBatchSize method optimisation should apply to StatelessSession as well

This commit is contained in:
Sanne Grinovero 2021-10-29 14:01:54 +01:00 committed by Sanne Grinovero
parent f9bc1a279a
commit 6c53a9d1ab
2 changed files with 14 additions and 14 deletions

View File

@ -233,6 +233,20 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont
}
}
/**
* Override the implementation provided on SharedSessionContractImplementor
* which is not very efficient: this method is hot in Hibernate Reactive, and could
* be hot in some ORM contexts as well.
* @return
*/
@Override
public Integer getConfiguredJdbcBatchSize() {
final Integer sessionJdbcBatchSize = this.jdbcBatchSize;
return sessionJdbcBatchSize == null ?
fastSessionServices.defaultJdbcBatchSize :
sessionJdbcBatchSize;
}
protected void addSharedSessionTransactionObserver(TransactionCoordinator transactionCoordinator) {
}

View File

@ -300,20 +300,6 @@ public class SessionImpl
return new ActionQueue( this );
}
/**
* Override the implementation provided on SharedSessionContractImplementor
* which is not very efficient: this method is hot in Hibernate Reactive, and could
* be hot in some ORM contexts as well.
* @return
*/
@Override
public Integer getConfiguredJdbcBatchSize() {
final Integer sessionJdbcBatchSize = getJdbcBatchSize();
return sessionJdbcBatchSize == null ?
fastSessionServices.defaultJdbcBatchSize :
sessionJdbcBatchSize;
}
private LockOptions getLockOptionsForRead() {
return this.lockOptions == null ? fastSessionServices.defaultLockOptions : this.lockOptions;
}