From 6c53a9d1abf1bb2e38cfbb986a8bb33188aacfb9 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Fri, 29 Oct 2021 14:01:54 +0100 Subject: [PATCH] HHH-14903 The new getConfiguredJdbcBatchSize method optimisation should apply to StatelessSession as well --- .../internal/AbstractSharedSessionContract.java | 14 ++++++++++++++ .../java/org/hibernate/internal/SessionImpl.java | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java b/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java index aeaf0634d1..62d59cad14 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java @@ -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) { } diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java index 53e8015dfc..6489891016 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java @@ -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; }