HHH-18173 Document Oracle Universal Connection Pool

This commit is contained in:
LLEFEVRE 2024-05-27 14:44:11 +02:00 committed by Christian Beikov
parent 53398df5f3
commit 0705ffd3b1
1 changed files with 35 additions and 2 deletions

View File

@ -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 -> <<database-connectionprovider-hikari>>
6. else if any setting prefixed by `hibernate.vibur.` is set -> <<database-connectionprovider-vibur>>
7. else if any setting prefixed by `hibernate.agroal.` is set -> <<database-connectionprovider-agroal>>
8. else if `hibernate.connection.url` is set -> <<database-connectionprovider-drivermanager>>
9. else -> <<database-connectionprovider-provided>>
8. else if any setting prefixed by `hibernate.oracleucp.` is set -> <<database-connectionprovider-ucp>>
9. else if `hibernate.connection.url` is set -> <<database-connectionprovider-drivermanager>>
10. else -> <<database-connectionprovider-provided>>
[[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 <<ConnectionProvider support for transaction isolation setting>>.
`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 <<ConnectionProvider support for transaction isolation setting>>.
`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