diff --git a/documentation/src/main/asciidoc/userguide/chapters/jdbc/Database_Access.adoc b/documentation/src/main/asciidoc/userguide/chapters/jdbc/Database_Access.adoc index a12ee7d7c9..b8fafb17eb 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/jdbc/Database_Access.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/jdbc/Database_Access.adoc @@ -20,8 +20,9 @@ Hibernate will internally determine which `ConnectionProvider` to use based on t 5. else if any setting prefixed by `hibernate.hikari.` is set -> <> 6. else if any setting prefixed by `hibernate.vibur.` is set -> <> 7. else if any setting prefixed by `hibernate.agroal.` is set -> <> -8. else if `hibernate.connection.url` is set -> <> -9. else -> <> +8. else if any setting prefixed by `hibernate.oracleucp.` is set -> <> +9. else if `hibernate.connection.url` is set -> <> +10. else -> <> [[database-connectionprovider-datasource]] === Using DataSources @@ -164,6 +165,38 @@ Additionally, this `ConnectionProvider` will pick up the following Hibernate-spe `hibernate.connection.isolation`:: Mapped to Agroal's `jdbcTransactionIsolation` setting. See <>. `hibernate.connection.autocommit`:: Mapped to Agroal's `autoCommit` setting +[[database-connectionprovider-ucp]] +=== Using Oracle Universal Connection Pool + +[IMPORTANT] +==== +To use the Universal Connection Pool (aka UCP) integration, the application must include the `hibernate-ucp` module jar (as well as its dependencies) on the classpath. +==== + +Hibernate also provides support for applications to use https://docs.oracle.com/en/database/oracle/oracle-database/23/jjucp/intro.html[Oracle Universal Connection Pool]. + +Set all of your UCP settings in Hibernate prefixed by `hibernate.oracleucp.` and this `ConnectionProvider` will pick them up and pass them along to UCP. +Additionally, this `ConnectionProvider` will pick up the following Hibernate-specific properties and map them to the corresponding UCP ones (any `hibernate.oracleucp.` prefixed ones have precedence): + +`hibernate.connection.url`:: Mapped to UCP's `URL` setting +`hibernate.connection.username`:: Mapped to UCP's `user` setting +`hibernate.connection.password`:: Mapped to UCP's `password` setting +`hibernate.connection.isolation`:: Used to initialize `Connection` retrieved from UCP. See <>. +`hibernate.connection.autocommit`:: Used to initialize `Connection` retrieved from UCP. +Any other settings prefixed with `hibernate.oracleucp.`:: Will have the `hibernate.oracleucp.` portion stripped and be passed to UCP. + +[IMPORTANT] +==== +You can pass further settings to the `Connection` provided by UCP by using the `hibernate.oracleucp.connectionProperties` property in the following manner: + +`hibernate.oracleucp.connectionProperties=oracle.jdbc.thinForceDNSLoadBalancing=true,oracle.jdbc.fanEnabled=true,oracle.jdbc.defaultConnectionValidation=SOCKET,oracle.jdbc.implicitStatementCacheSize=50,oracle.jdbc.loginTimeout=5000` +==== + +The Hibernate property `hibernate.oracleucp.connectionFactoryClassName` can be used to choose between: + +. a standard connection pool: `oracle.jdbc.pool.OracleDataSource` +. a _replay_ connection pool: `oracle.jdbc.replay.OracleDataSourceImpl` which allows using [Transparent] Application Continuity capabilities to mask planned and unplanned downtime + [[database-connectionprovider-drivermanager]] === Using Hibernate's built-in (and unsupported) pooling