diff --git a/documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc b/documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc index 4f6e399b80..a83368e176 100644 --- a/documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc +++ b/documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc @@ -600,9 +600,6 @@ A non-zero value determines the JDBC fetch size, by calling `Statement.setFetchS `*hibernate.jdbc.use_scrollable_resultset*` (e.g. `true` or `false`):: Enables Hibernate to use JDBC2 scrollable resultsets. This property is only relevant for user-supplied JDBC connections. Otherwise, Hibernate uses connection metadata. -`*hibernate.jdbc.use_streams_for_binary*` (e.g. `true` or `false` (default value)):: -Use streams when writing or reading `binary` or `serializable` types to or from JDBC. This is a system-level property. - `*hibernate.jdbc.use_get_generated_keys*` (e.g. `true` or `false`):: Allows Hibernate to use JDBC3 `PreparedStatement.getGeneratedKeys()` to retrieve natively-generated keys after insert. You need the JDBC3+ driver and JRE1.4+. Disable this property if your driver has problems with the Hibernate identifier generators. By default, it tries to detect the driver capabilities from connection metadata. diff --git a/etc/hibernate.properties b/etc/hibernate.properties index 65ccd239f1..5d71e4ca98 100644 --- a/etc/hibernate.properties +++ b/etc/hibernate.properties @@ -398,11 +398,6 @@ hibernate.jdbc.batch_versioned_data true #hibernate.jdbc.use_scrollable_resultset true -## use streams when writing binary types to / from JDBC - -hibernate.jdbc.use_streams_for_binary true - - ## use JDBC 3 PreparedStatement.getGeneratedKeys() to get the identifier of an inserted row #hibernate.jdbc.use_get_generated_keys false diff --git a/etc/hibernate.properties.template b/etc/hibernate.properties.template index 8a4e698d85..d39c87e0e7 100644 --- a/etc/hibernate.properties.template +++ b/etc/hibernate.properties.template @@ -362,11 +362,6 @@ hibernate.jdbc.batch_versioned_data true #hibernate.jdbc.use_scrollable_resultset true -## use streams when writing binary types to / from JDBC - -hibernate.jdbc.use_streams_for_binary true - - ## use JDBC 3 PreparedStatement.getGeneratedKeys() to get the identifier of an inserted row #hibernate.jdbc.use_get_generated_keys false diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CUBRIDDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CUBRIDDialect.java index 9aac119ccb..b95b711055 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CUBRIDDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CUBRIDDialect.java @@ -121,11 +121,6 @@ public class CUBRIDDialect extends Dialect { return 15; } - @Override - public boolean getDefaultUseStreamsForBinary() { - return true; - } - @Override public int getMaxVarcharLength() { return 1_073_741_823; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MimerSQLDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MimerSQLDialect.java index b343313e74..334dfa8cf7 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MimerSQLDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MimerSQLDialect.java @@ -107,11 +107,6 @@ public class MimerSQLDialect extends Dialect { return 50; } - @Override - public boolean getDefaultUseStreamsForBinary() { - return true; - } - @Override public void initializeFunctionRegistry(QueryEngine queryEngine) { super.initializeFunctionRegistry( queryEngine ); diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TeradataDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TeradataDialect.java index eab0310841..bf063e4a8a 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TeradataDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TeradataDialect.java @@ -124,7 +124,7 @@ public class TeradataDialect extends Dialect { } @Override - public boolean getDefaultUseStreamsForBinary() { + public boolean useInputStreamToInsertBlob() { return getVersion().isSameOrAfter( 14 ); } diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TimesTenDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TimesTenDialect.java index 5c23e4580f..2d4135909c 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TimesTenDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TimesTenDialect.java @@ -113,11 +113,6 @@ public class TimesTenDialect extends Dialect { return 15; } - @Override - public boolean getDefaultUseStreamsForBinary() { - return true; - } - @Override public JdbcType resolveSqlTypeDescriptor( String columnTypeName, diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java b/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java index a1b8b967bb..8f9c32eb04 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java @@ -11,7 +11,6 @@ import java.util.function.Supplier; import org.hibernate.HibernateException; import org.hibernate.jpa.HibernateHints; import org.hibernate.query.NativeQuery; -import org.hibernate.query.Query; import org.hibernate.Transaction; import org.hibernate.boot.MetadataBuilder; import org.hibernate.boot.registry.classloading.internal.TcclLookupPrecedence; @@ -776,11 +775,6 @@ public interface AvailableSettings { */ String DEFAULT_BATCH_FETCH_SIZE = "hibernate.default_batch_fetch_size"; - /** - * Use {@code java.io} streams to read / write binary data from / to JDBC - */ - String USE_STREAMS_FOR_BINARY = "hibernate.jdbc.use_streams_for_binary"; - /** * Use JDBC scrollable {@code ResultSet}s. This property is only necessary when there is * no {@code ConnectionProvider}, that is, when the client is supplying JDBC connections. diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java b/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java index ce74cb90b7..346a2c1cc3 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java @@ -34,11 +34,9 @@ import org.jboss.logging.Logger; *
+ * The only system-level property is {@value #USE_REFLECTION_OPTIMIZER}. + *
* {@code Environment} properties are populated by calling {@link System#getProperties()} * and then from a resource named {@code /hibernate.properties} if it exists. System * properties override properties specified in {@code hibernate.properties}. @@ -144,23 +142,11 @@ public final class Environment implements AvailableSettings { private static final CoreMessageLogger LOG = Logger.getMessageLogger( CoreMessageLogger.class, Environment.class.getName()); private static final BytecodeProvider BYTECODE_PROVIDER_INSTANCE; - private static final boolean ENABLE_BINARY_STREAMS; private static final boolean ENABLE_REFLECTION_OPTIMIZER; private static final boolean ENABLE_LEGACY_PROXY_CLASSNAMES; private static final Properties GLOBAL_PROPERTIES; - /** - * No longer effective. - * - * @param configurationValues The specified properties. - * @deprecated without replacement. Such verification is best done ad hoc, case by case. - */ - @Deprecated - public static void verifyProperties(Map,?> configurationValues) { - //Obsolete and Renamed properties are no longer handled here - } - static { Version.logVersion(); @@ -202,11 +188,6 @@ public final class Environment implements AvailableSettings { LOG.unableToCopySystemProperties(); } - ENABLE_BINARY_STREAMS = ConfigurationHelper.getBoolean(USE_STREAMS_FOR_BINARY, GLOBAL_PROPERTIES); - if ( ENABLE_BINARY_STREAMS ) { - LOG.usingStreams(); - } - ENABLE_REFLECTION_OPTIMIZER = ConfigurationHelper.getBoolean(USE_REFLECTION_OPTIMIZER, GLOBAL_PROPERTIES); if ( ENABLE_REFLECTION_OPTIMIZER ) { LOG.usingReflectionOptimizer(); @@ -232,24 +213,6 @@ public final class Environment implements AvailableSettings { return false; } - /** - * Should we use streams to bind binary types to JDBC IN parameters? - * - * @return True if streams should be used for binary data handling; false otherwise. - * - * @see #USE_STREAMS_FOR_BINARY - * - * @deprecated Deprecated to indicate that the method will be moved to - * {@link org.hibernate.boot.spi.SessionFactoryOptions} / - * {@link org.hibernate.boot.SessionFactoryBuilder} - probably in 6.0. - * See HHH-12194 and - * HHH-12193 for details - */ - @Deprecated - public static boolean useStreamsForBinary() { - return ENABLE_BINARY_STREAMS; - } - /** * Should we use reflection optimization? * diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java index b1e5730906..3a105ba973 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java @@ -281,8 +281,6 @@ public abstract class Dialect implements ConversionContext { protected void initDefaultProperties() { getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, Integer.toString( getDefaultStatementBatchSize() ) ); - getDefaultProperties().setProperty( Environment.USE_STREAMS_FOR_BINARY, - Boolean.toString( getDefaultUseStreamsForBinary() ) ); getDefaultProperties().setProperty( Environment.NON_CONTEXTUAL_LOB_CREATION, Boolean.toString( getDefaultNonContextualLobCreation() ) ); getDefaultProperties().setProperty( Environment.USE_GET_GENERATED_KEYS, @@ -1276,14 +1274,6 @@ public abstract class Dialect implements ConversionContext { return 1; } - /** - * The default value to use for the configuration property - * {@value Environment#USE_STREAMS_FOR_BINARY}. - */ - public boolean getDefaultUseStreamsForBinary() { - return false; - } - /** * The default value to use for the configuration property * {@value Environment#NON_CONTEXTUAL_LOB_CREATION}. diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java index 0c84594313..01cd7339d6 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java @@ -609,11 +609,6 @@ public class OracleDialect extends Dialect { return 15; } - @Override - public boolean getDefaultUseStreamsForBinary() { - return true; - } - @Override public boolean getDefaultUseGetGeneratedKeys() { // Oracle driver reports to support getGeneratedKeys(), but they only diff --git a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java index 2e3a144871..0347681eb9 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java @@ -1376,9 +1376,9 @@ public interface CoreMessageLogger extends BasicLogger { @Message(value = "Using bytecode reflection optimizer", id = 406) void usingReflectionOptimizer(); - @LogMessage(level = INFO) - @Message(value = "Using java.io streams to persist binary types", id = 407) - void usingStreams(); +// @LogMessage(level = INFO) +// @Message(value = "Using java.io streams to persist binary types", id = 407) +// void usingStreams(); @LogMessage(level = WARN) @Message(value = "Using %s which does not generate IETF RFC 4122 compliant UUID values; consider using %s instead", diff --git a/hibernate-core/src/main/java/org/hibernate/internal/FastSessionServices.java b/hibernate-core/src/main/java/org/hibernate/internal/FastSessionServices.java index e93a3b46d7..274e395b71 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/FastSessionServices.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/FastSessionServices.java @@ -220,7 +220,7 @@ public final class FastSessionServices { //Other highly useful constants: this.dialect = jdbcServices.getJdbcEnvironment().getDialect(); this.disallowOutOfTransactionUpdateOperations = !sessionFactoryOptions.isAllowOutOfTransactionUpdateOperations(); - this.useStreamForLobBinding = Environment.useStreamsForBinary() || dialect.useInputStreamToInsertBlob(); + this.useStreamForLobBinding = dialect.useInputStreamToInsertBlob(); this.preferredSqlTypeCodeForBoolean = sessionFactoryOptions.getPreferredSqlTypeCodeForBoolean(); this.defaultTimeZoneStorageStrategy = sessionFactoryOptions.getDefaultTimeZoneStorageStrategy(); this.defaultJdbcBatchSize = sessionFactoryOptions.getJdbcBatchSize(); diff --git a/hibernate-core/src/test/bundles/templates/cfgxmlpar/org/hibernate/orm/test/jpa/pack/cfgxmlpar/hibernate.cfg.xml b/hibernate-core/src/test/bundles/templates/cfgxmlpar/org/hibernate/orm/test/jpa/pack/cfgxmlpar/hibernate.cfg.xml index 13dc09a516..55fe571e17 100644 --- a/hibernate-core/src/test/bundles/templates/cfgxmlpar/org/hibernate/orm/test/jpa/pack/cfgxmlpar/hibernate.cfg.xml +++ b/hibernate-core/src/test/bundles/templates/cfgxmlpar/org/hibernate/orm/test/jpa/pack/cfgxmlpar/hibernate.cfg.xml @@ -18,7 +18,6 @@