Package oracle.ucp.jdbc
Class PoolXADataSourceImpl
- java.lang.Object
-
- oracle.ucp.jdbc.PoolDataSourceImpl
-
- oracle.ucp.jdbc.PoolXADataSourceImpl
-
- All Implemented Interfaces:
java.io.Serializable,java.sql.Wrapper,javax.naming.Referenceable,javax.naming.spi.ObjectFactory,javax.sql.CommonDataSource,javax.sql.DataSource,javax.sql.XADataSource,Diagnosable,PoolDataSource,PoolXADataSource,UniversalConnectionPoolAdapter
public class PoolXADataSourceImpl extends PoolDataSourceImpl implements PoolXADataSource, java.io.Serializable, javax.naming.Referenceable, javax.naming.spi.ObjectFactory, UniversalConnectionPoolAdapter
A connection pool-aware data source. This DataSource uses the Universal Connection Pool to get an XAconneciton, creating a proxy to that connection, and returning the proxy to the client. When the client calls close on the XAConnection proxy, the underlying physical connection is usually returned to the pool. Also see the proxy factory.Besides other data source properties, applications must set the connection factory class name. The connection factory class is a class that implements javax.sql.XADataSource and does not implement its own connection pooling. The connection factory's getXAConnection(...) methods should return a physical XAConnection to the database. For example, "oracle.jdbc.xa.client.OracleXADataSource" is a valid connection factory class name.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class oracle.ucp.jdbc.PoolDataSourceImpl
PoolDataSourceImpl.ConnectionPublisher<ConnectionBuilderType,ConnectionType>
-
Nested classes/interfaces inherited from interface oracle.ucp.jdbc.PoolDataSource
PoolDataSource.HostnameResolver
-
-
Field Summary
-
Fields inherited from class oracle.ucp.jdbc.PoolDataSourceImpl
COLOCATION_URL, SECRET_STORE_CONNECT, SECRET_STORE_DEFAULT_PASSWORD, SECRET_STORE_DEFAULT_USERNAME, SECRET_STORE_PASSWORD, SECRET_STORE_USERNAME
-
Fields inherited from interface oracle.ucp.jdbc.PoolDataSource
SYSTEM_PROPERTY_AFFINITY_STRICT, SYSTEM_PROPERTY_BEGIN_REQUEST_AT_CONNECTION_CREATION, SYSTEM_PROPERTY_CONNECTION_CREATION_RETRY_DELAY, SYSTEM_PROPERTY_CREATE_CONNECTION_IN_BORROW_THREAD, SYSTEM_PROPERTY_DESTROY_ON_RELOAD, SYSTEM_PROPERTY_DIAGNOSTIC_BUFFER_SIZE, SYSTEM_PROPERTY_DIAGNOSTIC_ENABLE_LOGGING, SYSTEM_PROPERTY_DIAGNOSTIC_ENABLE_TRACE, SYSTEM_PROPERTY_DIAGNOSTIC_ERROR_CODES_TO_WATCH_LIST, SYSTEM_PROPERTY_DIAGNOSTIC_LOGGING_LEVEL, SYSTEM_PROPERTY_ENABLE_SHUTDOWN_HOOK, SYSTEM_PROPERTY_FAN_ENABLED, SYSTEM_PROPERTY_IMITATE_ASYNC_BORROW, SYSTEM_PROPERTY_MAX_INIT_THREADS, SYSTEM_PROPERTY_PRE_WLS1212_COMPATIBLE, SYSTEM_PROPERTY_RLB_INOPERABILITY_TIMEOUT, SYSTEM_PROPERTY_SELFTUNING, SYSTEM_PROPERTY_TIMERS_AFFECT_ALL_CONNECTIONS, SYSTEM_PROPERTY_WLS_JTA, SYSTEM_PROPERTY_XML_CONFIG_FILE, UCP_ABANDONED_CONNECTION_TIMEOUT, UCP_COMMIT_ON_CONNECTION_RETURN, UCP_CONNECTION_AFFINITY_CALLBACK, UCP_CONNECTION_CREATION_CONSUMER, UCP_CONNECTION_FACTORY_CLASS_NAME, UCP_CONNECTION_FACTORY_PROPERTIES, UCP_CONNECTION_HARVEST_MAX_COUNT, UCP_CONNECTION_HARVEST_TRIGGER_COUNT, UCP_CONNECTION_INITIALIZATION_CALLBACK, UCP_CONNECTION_LABELING_CALLBACK, UCP_CONNECTION_LABELING_HIGH_COST, UCP_CONNECTION_POOL_NAME, UCP_CONNECTION_PROPERTIES, UCP_CONNECTION_REPURPOSE_THRESHOLD, UCP_CONNECTION_VALIDATION_TIMEOUT, UCP_CONNECTION_WAIT_DURATION, UCP_CONNECTION_WAIT_TIMEOUT, UCP_CREATE_CONNECTION_IN_BORROW_THREAD, UCP_DATA_SOURCE_FROM_CONFIGURATION, UCP_DATA_SOURCE_NAME, UCP_DATABASE_NAME, UCP_DESCRIPTION, UCP_FAST_CONNECTION_FAILOVER_ENABLED, UCP_HIGH_COST_CONNECTION_REUSE_THRESHOLD, UCP_INACTIVE_CONNECTION_TIMEOUT, UCP_INITIAL_POOL_SIZE, UCP_LOGIN_TIMEOUT, UCP_MAX_CONNECTION_REUSE_COUNT, UCP_MAX_CONNECTION_REUSE_TIME, UCP_MAX_CONNECTIONS_PER_SERVICE, UCP_MAX_CONNECTIONS_PER_SHARD, UCP_MAX_IDLE_TIME, UCP_MAX_POOL_SIZE, UCP_MAX_STATEMENTS, UCP_MIN_IDLE, UCP_MIN_POOL_SIZE, UCP_NETWORK_PROTOCOL, UCP_NTH_RETURNED_CONNECTION_TO_VALIDATE, UCP_ONS_CONFIGURATION, UCP_PASSWORD, UCP_PDB_ROLES, UCP_PORT_NUMBER, UCP_PROPERTY_CYCLE, UCP_READONLY_INSTANCE_ALLOWED, UCP_ROLE_NAME, UCP_SECONDS_TO_TRUST_IDLE_CONNECTION, UCP_SERVER_NAME, UCP_SERVICE_NAME, UCP_SHARDING_MODE, UCP_SQL_FOR_VALIDATE_CONNECTION, UCP_TIME_TO_LIVE_CONNECTION_TIMEOUT, UCP_TIMEOUT_CHECK_INTERVAL, UCP_URL, UCP_USER, UCP_VALIDATE_CONNECTION_ON_BORROW
-
-
Constructor Summary
Constructors Constructor Description PoolXADataSourceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreatePoolWithDefaultProperties()UCPXAConnectionBuildercreateXAConnectionBuilder()Creates a new XAConnectionBuilder instance.java.sql.ConnectiongetConnection()Attempts to obtain a database connection.java.sql.ConnectiongetConnection(java.lang.String username, java.lang.String password)Attempts to obtain a database connection.java.sql.ConnectiongetConnection(java.lang.String username, java.lang.String password, java.util.Properties labels)Attempts to obtain a database connection with the requested connection labels.java.sql.ConnectiongetConnection(java.util.Properties labels)Attempts to obtain a database connection with the requested connection labels.protected java.sql.ConnectiongetConnection(oracle.ucp.jdbc.UCPConnectionBuilderImpl builder)Internal method that attempts to obtain a database connection with the parameters set on the builder.javax.sql.XAConnectiongetXAConnection()Obtains an XAConnection from the embedded Universal Connection Pool instance.javax.sql.XAConnectiongetXAConnection(java.lang.String user, java.lang.String password)Obtains an XAConnection from the embedded Universal Connection Pool instance, using the given user name and password.javax.sql.XAConnectiongetXAConnection(java.lang.String username, java.lang.String password, java.util.Properties labels)Obtains an XAConnection from the embedded Universal Connection Pool instance, using the given user name, password, and connection labels.javax.sql.XAConnectiongetXAConnection(java.util.Properties labels)Obtains an XAConnection from the embedded Universal Connection Pool instance, using the given connection labels.-
Methods inherited from class oracle.ucp.jdbc.PoolDataSourceImpl
createConnectionBuilder, createUniversalConnectionPool, createUniversalConnectionPoolMBean, getAbandonedConnectionTimeout, getAvailableConnectionsCount, getBorrowedConnectionsCount, getConnectionCreationConsumer, getConnectionFactoryClassName, getConnectionFactoryProperties, getConnectionFactoryProperty, getConnectionHarvestMaxCount, getConnectionHarvestTriggerCount, getConnectionInitializationCallback, getConnectionLabelingHighCost, getConnectionPoolName, getConnectionProperties, getConnectionProperty, getConnectionRepurposeThreshold, getConnectionValidationTimeout, getConnectionWaitDuration, getConnectionWaitDurationInMillis, getConnectionWaitTimeout, getDatabaseName, getDataSourceName, getDescription, getDiagnosable, getFastConnectionFailoverEnabled, getHighCostConnectionReuseThreshold, getHostnameResolver, getInactiveConnectionTimeout, getInitialPoolSize, getLoginTimeout, getLogWriter, getMaxConnectionReuseCount, getMaxConnectionReuseTime, getMaxConnectionsPerService, getMaxConnectionsPerShard, getMaxIdleTime, getMaxPoolSize, getMaxStatements, getMinIdle, getMinPoolSize, getNetworkProtocol, getObjectInstance, getONSConfiguration, getParentLogger, getPdbRoles, getPortNumber, getPropertyCycle, getQueryTimeout, getReference, getRoleName, getSecondsToTrustIdleConnection, getServerName, getServiceName, getShardingMode, getSQLForValidateConnection, getSSLContext, getStatistics, getTimeoutCheckInterval, getTimeToLiveConnectionTimeout, getURL, getUser, getValidateConnectionOnBorrow, isCommitOnConnectionReturn, isCreateConnectionInBorrowThread, isReadOnlyInstanceAllowed, isSetOnceProperty, isWrapperFor, reconfigureDataSource, registerConnectionAffinityCallback, registerConnectionCreationConsumer, registerConnectionInitializationCallback, registerConnectionLabelingCallback, removeConnectionAffinityCallback, removeConnectionLabelingCallback, setAbandonedConnectionTimeout, setCommitOnConnectionReturn, setConnectionFactoryClassName, setConnectionFactoryProperties, setConnectionFactoryProperty, setConnectionHarvestMaxCount, setConnectionHarvestTriggerCount, setConnectionLabelingHighCost, setConnectionPoolName, setConnectionProperties, setConnectionProperty, setConnectionRepurposeThreshold, setConnectionValidationTimeout, setConnectionWaitDuration, setConnectionWaitDurationInMillis, setConnectionWaitTimeout, setCreateConnectionInBorrowThread, setDatabaseName, setDataSourceName, setDescription, setFastConnectionFailoverEnabled, setHighCostConnectionReuseThreshold, setHostnameResolver, setInactiveConnectionTimeout, setInitialPoolSize, setLoginTimeout, setLogWriter, setMaxConnectionReuseCount, setMaxConnectionReuseTime, setMaxConnectionsPerShard, setMaxIdleTime, setMaxPoolSize, setMaxStatements, setMinIdle, setMinPoolSize, setNetworkProtocol, setONSConfiguration, setPassword, setPortNumber, setPropertyCycle, setQueryTimeout, setReadOnlyInstanceAllowed, setRoleName, setSecondsToTrustIdleConnection, setServerName, setShardingMode, setSQLForValidateConnection, setSSLContext, setTimeoutCheckInterval, setTimeToLiveConnectionTimeout, setTokenSupplier, setURL, setUser, setValidateConnectionOnBorrow, startPool, startPool, startPool, toBasicType, unregisterConnectionCreationConsumer, unregisterConnectionInitializationCallback, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.sql.DataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
-
Methods inherited from interface oracle.ucp.diagnostics.Diagnosable
beginCurrentSql, debug, debug, endCurrentSql, format, getDiagnosable, isLoggingLevelFinest, resumeLogging, secure, suspendLogging, trace, trace
-
Methods inherited from interface oracle.ucp.jdbc.PoolDataSource
createConnectionBuilder, createShardingKeyBuilder, getAbandonedConnectionTimeout, getAvailableConnectionsCount, getBorrowedConnectionsCount, getConnectionCreationConsumer, getConnectionFactoryClassName, getConnectionFactoryProperties, getConnectionFactoryProperty, getConnectionHarvestMaxCount, getConnectionHarvestTriggerCount, getConnectionInitializationCallback, getConnectionLabelingHighCost, getConnectionPoolName, getConnectionProperties, getConnectionProperty, getConnectionRepurposeThreshold, getConnectionValidationTimeout, getConnectionWaitDuration, getConnectionWaitTimeout, getDatabaseName, getDataSourceName, getDescription, getFastConnectionFailoverEnabled, getHighCostConnectionReuseThreshold, getInactiveConnectionTimeout, getInitialPoolSize, getMaxConnectionReuseCount, getMaxConnectionReuseTime, getMaxConnectionsPerService, getMaxConnectionsPerShard, getMaxIdleTime, getMaxPoolSize, getMaxStatements, getMinIdle, getMinPoolSize, getNetworkProtocol, getONSConfiguration, getPassword, getPdbRoles, getPortNumber, getPropertyCycle, getQueryTimeout, getRoleName, getSecondsToTrustIdleConnection, getServerName, getServiceName, getShardingMode, getSQLForValidateConnection, getStatistics, getTimeoutCheckInterval, getTimeToLiveConnectionTimeout, getURL, getUser, getValidateConnectionOnBorrow, isCommitOnConnectionReturn, isCreateConnectionInBorrowThread, isReadOnlyInstanceAllowed, reconfigureDataSource, registerConnectionAffinityCallback, registerConnectionCreationConsumer, registerConnectionInitializationCallback, registerConnectionLabelingCallback, removeConnectionAffinityCallback, removeConnectionLabelingCallback, setAbandonedConnectionTimeout, setCommitOnConnectionReturn, setConnectionFactoryClassName, setConnectionFactoryProperties, setConnectionFactoryProperty, setConnectionHarvestMaxCount, setConnectionHarvestTriggerCount, setConnectionLabelingHighCost, setConnectionPoolName, setConnectionProperties, setConnectionProperty, setConnectionRepurposeThreshold, setConnectionValidationTimeout, setConnectionWaitDuration, setConnectionWaitTimeout, setCreateConnectionInBorrowThread, setDatabaseName, setDataSourceName, setDescription, setFastConnectionFailoverEnabled, setHighCostConnectionReuseThreshold, setHostnameResolver, setInactiveConnectionTimeout, setInitialPoolSize, setMaxConnectionReuseCount, setMaxConnectionReuseTime, setMaxConnectionsPerShard, setMaxIdleTime, setMaxPoolSize, setMaxStatements, setMinIdle, setMinPoolSize, setNetworkProtocol, setONSConfiguration, setPassword, setPortNumber, setPropertyCycle, setQueryTimeout, setReadOnlyInstanceAllowed, setRoleName, setSecondsToTrustIdleConnection, setServerName, setShardingMode, setSQLForValidateConnection, setSSLContext, setTimeoutCheckInterval, setTimeToLiveConnectionTimeout, setTokenSupplier, setURL, setUser, setValidateConnectionOnBorrow, unregisterConnectionCreationConsumer, unregisterConnectionInitializationCallback
-
Methods inherited from interface oracle.ucp.UniversalConnectionPoolAdapter
createUniversalConnectionPool, createUniversalConnectionPoolMBean
-
-
-
-
Method Detail
-
createPoolWithDefaultProperties
protected void createPoolWithDefaultProperties() throws java.sql.SQLException- Overrides:
createPoolWithDefaultPropertiesin classPoolDataSourceImpl- Throws:
java.sql.SQLException
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLExceptionDescription copied from class:PoolDataSourceImplAttempts to obtain a database connection.- Specified by:
getConnectionin interfacejavax.sql.DataSource- Overrides:
getConnectionin classPoolDataSourceImpl- Returns:
- A Connection to the database.
- Throws:
java.sql.SQLException- if a database-access error occurs.
-
getConnection
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLExceptionDescription copied from class:PoolDataSourceImplAttempts to obtain a database connection.- Specified by:
getConnectionin interfacejavax.sql.DataSource- Overrides:
getConnectionin classPoolDataSourceImpl- Parameters:
username- The database user on whose behalf the connection is being made.password- The user's password.- Returns:
- A Connection to the database.
- Throws:
java.sql.SQLException- if a database-access error occurs.
-
getConnection
public java.sql.Connection getConnection(java.util.Properties labels) throws java.sql.SQLExceptionDescription copied from class:PoolDataSourceImplAttempts to obtain a database connection with the requested connection labels.- Specified by:
getConnectionin interfacePoolDataSource- Overrides:
getConnectionin classPoolDataSourceImpl- Parameters:
labels- The requested connection labels.- Returns:
- A Connection to the database.
- Throws:
java.sql.SQLException- if a database-access error occurs.
-
getConnection
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password, java.util.Properties labels) throws java.sql.SQLExceptionDescription copied from class:PoolDataSourceImplAttempts to obtain a database connection with the requested connection labels.- Specified by:
getConnectionin interfacePoolDataSource- Overrides:
getConnectionin classPoolDataSourceImpl- Parameters:
username- The database user on whose behalf the connection is being made.password- The user's password.labels- The requested connection labels.- Returns:
- A Connection to the database.
- Throws:
java.sql.SQLException- if a database-access error occurs.
-
getXAConnection
public javax.sql.XAConnection getXAConnection() throws java.sql.SQLExceptionObtains an XAConnection from the embedded Universal Connection Pool instance. Each XAConnection represents a physical database connection can be used in a distributed transaction.- Specified by:
getXAConnectionin interfacePoolXADataSource- Specified by:
getXAConnectionin interfacejavax.sql.XADataSource- Returns:
- an
XAConnectionobject, which represents a physical connection to a data source, that can be used in a distributed transaction - Throws:
java.sql.SQLException- if a database access error occurs
-
getXAConnection
public javax.sql.XAConnection getXAConnection(java.lang.String user, java.lang.String password) throws java.sql.SQLExceptionObtains an XAConnection from the embedded Universal Connection Pool instance, using the given user name and password. Each XAConnection represents a physical database connection can be used in a distributed transaction.- Specified by:
getXAConnectionin interfacePoolXADataSource- Specified by:
getXAConnectionin interfacejavax.sql.XADataSource- Parameters:
user- The database user on whose behalf the connection is being made.password- The user's password.- Returns:
- an
XAConnectionobject, which represents a physical connection to a data source, that can be used in a distributed transaction. - Throws:
java.sql.SQLException- if a database access error occurs.
-
getXAConnection
public javax.sql.XAConnection getXAConnection(java.util.Properties labels) throws java.sql.SQLExceptionObtains an XAConnection from the embedded Universal Connection Pool instance, using the given connection labels. Each XAConnection represents a physical database connection can be used in a distributed transaction.- Specified by:
getXAConnectionin interfacePoolXADataSource- Parameters:
labels- The requested connection labels.- Returns:
- an
XAConnectionobject, which represents a physical connection to a data source, that can be used in a distributed transaction. - Throws:
java.sql.SQLException- if a database access error occurs.
-
getXAConnection
public javax.sql.XAConnection getXAConnection(java.lang.String username, java.lang.String password, java.util.Properties labels) throws java.sql.SQLExceptionObtains an XAConnection from the embedded Universal Connection Pool instance, using the given user name, password, and connection labels. Each XAConnection represents a physical database connection can be used in a distributed transaction.- Specified by:
getXAConnectionin interfacePoolXADataSource- Parameters:
username- The database user on whose behalf the connection is being made.password- The user's password.labels- The requested connection labels.- Returns:
- an
XAConnectionobject, which represents a physical connection to a data source, that can be used in a distributed transaction. - Throws:
java.sql.SQLException- if a database access error occurs.
-
getConnection
protected java.sql.Connection getConnection(oracle.ucp.jdbc.UCPConnectionBuilderImpl builder) throws java.sql.SQLExceptionDescription copied from class:PoolDataSourceImplInternal method that attempts to obtain a database connection with the parameters set on the builder.- Overrides:
getConnectionin classPoolDataSourceImpl- Parameters:
builder- the builder object containing the connection properties- Returns:
- A Connection to the database.
- Throws:
java.sql.SQLException- if a database-access error occurs.
-
createXAConnectionBuilder
public UCPXAConnectionBuilder createXAConnectionBuilder()
Description copied from interface:PoolXADataSourceCreates a new XAConnectionBuilder instance.- Specified by:
createXAConnectionBuilderin interfacePoolXADataSource- Specified by:
createXAConnectionBuilderin interfacejavax.sql.XADataSource- Returns:
- Connection builder that builds OracleXAConnection
-
-