Skip to content

Commit 5958f3d

Browse files
committed
HHH-18621 remove hibernate.jdbc.batch_versioned_data
since it has had no effect for some time and the "tests" for it weren't really testing anything :-/
1 parent 54ba22d commit 5958f3d

File tree

16 files changed

+19
-243
lines changed

16 files changed

+19
-243
lines changed

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/OracleLegacyDialect.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,21 @@
2020
import org.hibernate.QueryTimeoutException;
2121
import org.hibernate.boot.model.FunctionContributions;
2222
import org.hibernate.boot.model.TypeContributions;
23-
import org.hibernate.cfg.Environment;
24-
import org.hibernate.dialect.*;
23+
import org.hibernate.dialect.BooleanDecoder;
24+
import org.hibernate.dialect.DatabaseVersion;
25+
import org.hibernate.dialect.Dialect;
26+
import org.hibernate.dialect.DmlTargetColumnQualifierSupport;
27+
import org.hibernate.dialect.OracleBooleanJdbcType;
28+
import org.hibernate.dialect.OracleJdbcHelper;
29+
import org.hibernate.dialect.OracleJsonArrayJdbcTypeConstructor;
30+
import org.hibernate.dialect.OracleJsonJdbcType;
31+
import org.hibernate.dialect.OracleReflectionStructJdbcType;
32+
import org.hibernate.dialect.OracleTypes;
33+
import org.hibernate.dialect.OracleUserDefinedTypeExporter;
34+
import org.hibernate.dialect.OracleXmlJdbcType;
35+
import org.hibernate.dialect.Replacer;
36+
import org.hibernate.dialect.RowLockStrategy;
37+
import org.hibernate.dialect.TimeZoneSupport;
2538
import org.hibernate.dialect.aggregate.AggregateSupport;
2639
import org.hibernate.dialect.aggregate.OracleAggregateSupport;
2740
import org.hibernate.dialect.function.CommonFunctionFactory;
@@ -788,13 +801,6 @@ public TimeZoneSupport getTimeZoneSupport() {
788801
return getVersion().isSameOrAfter( 9 ) ? TimeZoneSupport.NATIVE : TimeZoneSupport.NONE;
789802
}
790803

791-
@Override
792-
protected void initDefaultProperties() {
793-
super.initDefaultProperties();
794-
String newerVersion = Boolean.toString( getVersion().isSameOrAfter( 12 ) );
795-
getDefaultProperties().setProperty( Environment.BATCH_VERSIONED_DATA, newerVersion );
796-
}
797-
798804
@Override
799805
public int getDefaultStatementBatchSize() {
800806
return 15;

hibernate-core/src/main/java/org/hibernate/boot/SessionFactoryBuilder.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -564,19 +564,6 @@ public interface SessionFactoryBuilder {
564564
*/
565565
SessionFactoryBuilder applyJdbcBatchSize(int size);
566566

567-
/**
568-
* This setting controls whether versioned entities will be included in JDBC batching. The reason
569-
* being that some JDBC drivers have a problems returning "accurate" update counts from batch statements.
570-
* This is setting is {@code false} by default.
571-
*
572-
* @param enabled The batch size to use.
573-
*
574-
* @return {@code this}, for method chaining
575-
*
576-
* @see org.hibernate.cfg.AvailableSettings#BATCH_VERSIONED_DATA
577-
*/
578-
SessionFactoryBuilder applyJdbcBatchingForVersionedEntities(boolean enabled);
579-
580567
/**
581568
* Should scrollable results be supported in queries? We ask the JDBC driver whether it
582569
* supports scrollable result sets as the default for this setting, but some drivers do not

hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryBuilderImpl.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,6 @@ public SessionFactoryBuilder applyJdbcBatchSize(int size) {
318318
return this;
319319
}
320320

321-
@Override
322-
public SessionFactoryBuilder applyJdbcBatchingForVersionedEntities(boolean enabled) {
323-
this.optionsBuilder.enableJdbcBatchingForVersionedEntities( enabled );
324-
return this;
325-
}
326-
327321
@Override
328322
public SessionFactoryBuilder applyScrollableResultsSupport(boolean enabled) {
329323
this.optionsBuilder.enableScrollableResultSupport( enabled );

hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ public class SessionFactoryOptionsBuilder implements SessionFactoryOptions {
222222
// JDBC Handling
223223
private boolean getGeneratedKeysEnabled;
224224
private int jdbcBatchSize;
225-
private boolean jdbcBatchVersionedData;
226225
private Integer jdbcFetchSize;
227226
private boolean scrollableResultSetsEnabled;
228227
private boolean commentsEnabled;
@@ -465,8 +464,6 @@ public SessionFactoryOptionsBuilder(StandardServiceRegistry serviceRegistry, Boo
465464
jdbcBatchSize = disallowBatchUpdates( dialect, meta ) ? 0
466465
: getInt( STATEMENT_BATCH_SIZE, settings, 1 );
467466

468-
jdbcBatchVersionedData = getBoolean( BATCH_VERSIONED_DATA, settings, true );
469-
470467
scrollableResultSetsEnabled =
471468
getBoolean( USE_SCROLLABLE_RESULTSET, settings, meta.supportsScrollableResults() );
472469
getGeneratedKeysEnabled =
@@ -1054,11 +1051,6 @@ public int getJdbcBatchSize() {
10541051
return jdbcBatchSize;
10551052
}
10561053

1057-
@Override
1058-
public boolean isJdbcBatchVersionedData() {
1059-
return jdbcBatchVersionedData;
1060-
}
1061-
10621054
@Override
10631055
public boolean isScrollableResultSetsEnabled() {
10641056
return scrollableResultSetsEnabled;
@@ -1469,10 +1461,6 @@ public void applyJdbcBatchSize(int size) {
14691461
this.jdbcBatchSize = size;
14701462
}
14711463

1472-
public void enableJdbcBatchingForVersionedEntities(boolean enabled) {
1473-
this.jdbcBatchVersionedData = enabled;
1474-
}
1475-
14761464
public void enableScrollableResultSupport(boolean enabled) {
14771465
this.scrollableResultSetsEnabled = enabled;
14781466
}

hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingSessionFactoryBuilder.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,6 @@ public T applyJdbcBatchSize(int size) {
286286
return getThis();
287287
}
288288

289-
@Override
290-
public T applyJdbcBatchingForVersionedEntities(boolean enabled) {
291-
delegate.applyJdbcBatchingForVersionedEntities( enabled );
292-
return getThis();
293-
}
294-
295289
@Override
296290
public T applyScrollableResultsSupport(boolean enabled) {
297291
delegate.applyScrollableResultsSupport( enabled );

hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingSessionFactoryOptions.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,6 @@ public int getJdbcBatchSize() {
304304
return delegate.getJdbcBatchSize();
305305
}
306306

307-
@Override
308-
public boolean isJdbcBatchVersionedData() {
309-
return delegate.isJdbcBatchVersionedData();
310-
}
311-
312307
@Override
313308
public boolean isScrollableResultSetsEnabled() {
314309
return delegate.isScrollableResultSetsEnabled();

hibernate-core/src/main/java/org/hibernate/boot/spi/SessionFactoryOptions.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,6 @@ default boolean isAllowRefreshDetachedEntity() {
297297
*/
298298
int getJdbcBatchSize();
299299

300-
/**
301-
* @see org.hibernate.cfg.BatchSettings#BATCH_VERSIONED_DATA
302-
*/
303-
boolean isJdbcBatchVersionedData();
304-
305300
/**
306301
* @see org.hibernate.cfg.JdbcSettings#USE_SCROLLABLE_RESULTSET
307302
*/

hibernate-core/src/main/java/org/hibernate/cfg/BatchSettings.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ public interface BatchSettings {
5353
*/
5454
String ORDER_INSERTS = "hibernate.order_inserts";
5555

56-
/**
57-
* When enabled, specifies that {@linkplain jakarta.persistence.Version versioned}
58-
* data should be included in batching.
59-
*
60-
* @see org.hibernate.boot.SessionFactoryBuilder#applyJdbcBatchingForVersionedEntities(boolean)
61-
*
62-
* @settingDefault Generally {@code true}, though can vary based on Dialect
63-
*/
64-
String BATCH_VERSIONED_DATA = "hibernate.jdbc.batch_versioned_data";
65-
6656
/**
6757
* @deprecated Use {@link #BUILDER} instead
6858
*/

hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
import static org.hibernate.LockOptions.NO_WAIT;
105105
import static org.hibernate.LockOptions.SKIP_LOCKED;
106106
import static org.hibernate.LockOptions.WAIT_FOREVER;
107-
import static org.hibernate.cfg.AvailableSettings.BATCH_VERSIONED_DATA;
108107
import static org.hibernate.dialect.OracleJdbcHelper.getArrayJdbcTypeConstructor;
109108
import static org.hibernate.dialect.OracleJdbcHelper.getNestedTableJdbcTypeConstructor;
110109
import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate;
@@ -834,12 +833,6 @@ public TimeZoneSupport getTimeZoneSupport() {
834833
return TimeZoneSupport.NATIVE;
835834
}
836835

837-
@Override
838-
protected void initDefaultProperties() {
839-
super.initDefaultProperties();
840-
getDefaultProperties().setProperty( BATCH_VERSIONED_DATA, "true" );
841-
}
842-
843836
@Override
844837
public int getDefaultStatementBatchSize() {
845838
return 15;

hibernate-core/src/test/java/org/hibernate/orm/test/cache/CollectionCacheEmbeddedIdKeyTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
@ServiceRegistry( settings = {
5151
@Setting( name = AvailableSettings.USE_SECOND_LEVEL_CACHE, value = "true" ),
5252
@Setting( name = AvailableSettings.DEFAULT_BATCH_FETCH_SIZE, value = "30" ),
53-
@Setting( name = AvailableSettings.BATCH_VERSIONED_DATA, value = "true" ),
5453
} )
5554
@Jira( "https://hibernate.atlassian.net/browse/HHH-16845" )
5655
public class CollectionCacheEmbeddedIdKeyTest {

0 commit comments

Comments
 (0)