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 e11094ba7e..3d09ce15b9 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java @@ -50,7 +50,7 @@ import org.jboss.logging.Logger; * * {@value #CONNECTION_PROVIDER} * name of a {@link org.hibernate.engine.jdbc.connections.spi.ConnectionProvider} - * subclass (if not specified heuristics are used) + * subclass (if not specified, heuristics are used) * * {@value #USER}database username * {@value #PASS}database password diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/JdbcSettings.java b/hibernate-core/src/main/java/org/hibernate/cfg/JdbcSettings.java index 2fdb4f27ac..eeef6ac613 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/JdbcSettings.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/JdbcSettings.java @@ -225,17 +225,17 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett String DIALECT_RESOLVERS = "hibernate.dialect_resolvers"; /** - * Specifies a {@link ConnectionProvider} - * to use for obtaining JDBC connections, either: + * Specifies a {@link ConnectionProvider} to use for obtaining JDBC connections, + * either: * - *

- * The term {@code "class"} appears in the setting name due to legacy reasons; - * however it can accept instances. + * + * @apiNote The term {@code "class"} appears in the setting name due to legacy reasons; + * however it can accept instances. */ String CONNECTION_PROVIDER = "hibernate.connection.provider_class"; @@ -249,14 +249,24 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett String POOL_SIZE = "hibernate.connection.pool_size"; /** - * Specified the JDBC transaction isolation level. + * Specifies the JDBC transaction isolation level for connections obtained + * from any {@link ConnectionProvider} implementation which respects this + * setting, including every built-in implementation except for + * {@link org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl}. + *

+ * Possible values are enumerated by {@link java.sql.Connection}: + * {@code NONE}, {@code READ_UNCOMMITTED}, {@code READ_COMMITTED}, + * {@code REPEATABLE_READ}, {@code SERIALIZABLE}. + *

+ * If this setting is not explicitly specified, Hibernate does not modify + * the transaction isolation level of the JDBC connection. */ String ISOLATION = "hibernate.connection.isolation"; /** * Controls the autocommit mode of JDBC connections obtained from any * {@link ConnectionProvider} implementation which respects this setting, - * which includes the built-in implementations do, except for + * including every built-in implementation except for * {@link org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl}. * * @settingDefault {@code false} @@ -264,16 +274,16 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett String AUTOCOMMIT = "hibernate.connection.autocommit"; /** - * Indicates that Connections obtained from the configured {@link ConnectionProvider} have + * Indicates that connections obtained from the configured {@link ConnectionProvider} have * auto-commit already disabled when they are acquired. *

- * It is inappropriate to set this value to {@code true} when the Connections returned by - * the provider do not, in fact, have auto-commit disabled. Doing so may lead to Hibernate + * It is inappropriate to set this value to {@code true} when the connections returned by + * the provider do not, in fact, have auto-commit disabled. Doing so may lead to Hibernate * executing SQL operations outside the scope of any transaction. * - * @apiNote By default, Hibernate calls {@link java.sql.Connection#setAutoCommit(boolean)} on - * newly-obtained connections. This setting allows to circumvent that call (as well as other - * operations) in the interest of performance. + * @apiNote By default, Hibernate calls {@link java.sql.Connection#setAutoCommit(boolean)} + * on newly-obtained connections. With this setting enabled, that call is skipped, along + * with some other operations, in the interest of performance. * * @settingDefault {@code false} * @@ -289,7 +299,11 @@ public interface JdbcSettings extends C3p0Settings, AgroalSettings, HikariCPSett *

* For example, declaring {@code hibernate.connection.foo=bar} tells Hibernate to * append {@code foo=bar} to the JDBC connection URL. + * + * @deprecated This setting is only supported by {@code C3P0ConnectionProvider} + * and {@link org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl}. */ + @Deprecated(since="7") String CONNECTION_PREFIX = "hibernate.connection"; /** diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProviderImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProviderImpl.java index 51292cab2e..90e3adb281 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProviderImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DriverManagerConnectionProviderImpl.java @@ -178,7 +178,6 @@ public class DriverManagerConnectionProviderImpl ); return factory.create( - driver, serviceRegistry, url,