Skip to content

Commit 6c53a9d

Browse files
committed
HHH-14903 The new getConfiguredJdbcBatchSize method optimisation should apply to StatelessSession as well
1 parent f9bc1a2 commit 6c53a9d

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,20 @@ public AbstractSharedSessionContract(SessionFactoryImpl factory, SessionCreation
233233
}
234234
}
235235

236+
/**
237+
* Override the implementation provided on SharedSessionContractImplementor
238+
* which is not very efficient: this method is hot in Hibernate Reactive, and could
239+
* be hot in some ORM contexts as well.
240+
* @return
241+
*/
242+
@Override
243+
public Integer getConfiguredJdbcBatchSize() {
244+
final Integer sessionJdbcBatchSize = this.jdbcBatchSize;
245+
return sessionJdbcBatchSize == null ?
246+
fastSessionServices.defaultJdbcBatchSize :
247+
sessionJdbcBatchSize;
248+
}
249+
236250
protected void addSharedSessionTransactionObserver(TransactionCoordinator transactionCoordinator) {
237251
}
238252

hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,6 @@ protected ActionQueue createActionQueue() {
300300
return new ActionQueue( this );
301301
}
302302

303-
/**
304-
* Override the implementation provided on SharedSessionContractImplementor
305-
* which is not very efficient: this method is hot in Hibernate Reactive, and could
306-
* be hot in some ORM contexts as well.
307-
* @return
308-
*/
309-
@Override
310-
public Integer getConfiguredJdbcBatchSize() {
311-
final Integer sessionJdbcBatchSize = getJdbcBatchSize();
312-
return sessionJdbcBatchSize == null ?
313-
fastSessionServices.defaultJdbcBatchSize :
314-
sessionJdbcBatchSize;
315-
}
316-
317303
private LockOptions getLockOptionsForRead() {
318304
return this.lockOptions == null ? fastSessionServices.defaultLockOptions : this.lockOptions;
319305
}

0 commit comments

Comments
 (0)