HHH-14899 Have SessionImpl override the default method getConfiguredJdbcBatchSize
This commit is contained in:
parent
5ad60c4b61
commit
959dfea66f
|
@ -160,6 +160,7 @@ public final class FastSessionServices {
|
|||
final boolean discardOnClose;
|
||||
final BaselineSessionEventsListenerBuilder defaultSessionEventListeners;
|
||||
final LockOptions defaultLockOptions;
|
||||
final int defaultJdbcBatchSize;
|
||||
|
||||
//Private fields:
|
||||
private final Dialect dialect;
|
||||
|
@ -217,6 +218,7 @@ public final class FastSessionServices {
|
|||
this.disallowOutOfTransactionUpdateOperations = !sessionFactoryOptions.isAllowOutOfTransactionUpdateOperations();
|
||||
this.useStreamForLobBinding = Environment.useStreamsForBinary() || dialect.useInputStreamToInsertBlob();
|
||||
this.requiresMultiTenantConnectionProvider = sf.getSettings().getMultiTenancyStrategy().requiresMultiTenantConnectionProvider();
|
||||
this.defaultJdbcBatchSize = sessionFactoryOptions.getJdbcBatchSize();
|
||||
|
||||
//Some "hot" services:
|
||||
this.connectionProvider = requiresMultiTenantConnectionProvider ? null : sr.getService( ConnectionProvider.class );
|
||||
|
|
|
@ -300,6 +300,20 @@ 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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue