This preface contains:
The following are changes in Oracle Universal Connection Pool for JDBC Developer's Guide for Oracle Database 12c Release 1 (12.1).
The following features are new in this release:
Support for Application Continuity
Support for Global Data Services
Support for Database Resident Connection Pool
Database Resident Connection Pool (DRCP) is a connection pool in the server that is shared across many clients. You should use DRCP in connection pools where the number of active connections is fairly less than the number of open connections. Universal Connection Pool for JDBC completely supports DRCP feature.
See Also:
Oracle Database JDBC Developer's Guide for more information about Database Resident Connection PoolSupport for graceful draining for planned outages
To enable sharing a common pool of connections across multiple PDBs (pluggable databases) or tenants, Oracle JDBC and UCP furnish the multitenant data source for Java. In Oracle Database 12c Release 1 (12.1), it is based on a combination of the following:
Global database user with access privileges to any PDB
UCP connection labeling
The new SET CONTAINER
statement within a callback function:
The advantage of the SET CONTAINER
statement is that the pool does not have to create a new connection to a PDB, if there is an existing connection to a different PDB. The pool can use the existing connection and can connect to the desired PDB through the SET CONTAINER
statement. Use the following command to achieve this:
ALTER SESSION SET CONTAINER
=<PDB Name>
This avoids the need to create a new connection from scratch.
The UCP connection labeling callback interface
Following is an illustration of how multitenant data source for Java works:
Tenant1
asks for a connection to PDB1
, by calling the getConnection()
method with the corresponding label that is mapped to a database ID.
UCP searches the pool for a free connection, tentatively with the specified label.
If Conn1
label reads PDB1
, then the connection is handed to JDBC, and then to Tenant1
for use.
Otherwise, if Conn1
label does not read PDB1
, then the following occur:
UCP uses the ALTER SESSION SET CONTAINER
statement and invokes the user-implemented callback configure
method to set Conn1
to PDB1
.
The SET CONTAINER
statement is passed to the server and parsed.
The server executes the statement, and assigns the PDB-specific role to Tenant1
Foot 1 .
The server then connects Conn1
to PDB1
, and then returns the corresponding database ID (dbid
) and other properties to JDBC.
JDBC notifies UCP and hands Conn1
to Tenant1
for use.
See Also:
The multitenant data source for Java white paper posted on Oracle Technology Network:http://www.oracle.com/technetwork/database/application-development/index-099369.html
Footnote Legend
Footnote 1: If you are a global user in a PDB, then you cannot perform many tasks without a password-protected role.