public class OracleXADataSourceImpl extends OracleXADataSource
XADataSource implementation that provides Application Continuity protection for applications using only local transactions or local transactions that are promotable to global/XA transactions.
Both JDBC and Java Transaction API (JTA) allow a JDBC connection to interchangeably participate in local and global/XA transactions. However, many customer applications obtain connections from an XA data source, but use these connections to perform only local transactions. These applications can use this data source to get AC protection.
Whenever an underlying physical connection starts to participate in a global/XA transaction, or engage in any XA operation, replay is disabled on that connection. The XA operations function normally, but the application does not get Application Continuity protection.
Once replay is disabled on a connection for the above reasons, it remains disabled until the next request begin. Switching from global/XA transaction to local transaction mode does not automatically re-enable replay on a connection.
The following example illustrates the use of this data source to
create a JDBC XAConnection
:
oracle.jdbc.xa.client.OracleXADataSource oxads =
new oracle.jdbc.xa.client.OracleXADataSource();
oxads.setURL("jdbc:oracle:thin:@//dbhost:dbport/dbservice");
oxads.setUser("User");
oxads.setPassword("Passwd");
oxads.setConnectionProperty("connProp1", "value1");
oxads.setConnectionProperty("connProp2", "value2");
javax.sql.XAConnection xaconn = oxads.getXAConnection();
The following example illustrates the use of a connection obtained from this data source for Application Continuity protection:
oracle.jdbc.replay.OracleXADataSource rxads =
new oracle.jdbc.replay.OracleXADataSourceImpl();
rxads.setURL("jdbc:oracle:thin:@//dbhost:dbport/dbservice");
rxads.setUser("User");
rxads.setPassword("Passwd");
rxads.setConnectionProperty("connProp1", "value1");
rxads.setConnectionProperty("connProp2", "value2");
XAConnection xaconn = rxads.getXAConnection();
Connection conn = xaconn.getConnection(); // Implicit request begin
...... // JDBC calls protected by Application Continuity
conn.close(); // Implicit request end
useNativeXA
CHECKSUM_PROPERTY, clientChecksum11203x, clientChecksum12x, connectionProperties, databaseName, dataSourceName, DEFAULT_SERVICE_NAME, description, doneDumpOnMemoryPressure, driver, driverType, ENABLE_AC_SUPPORT_PROPERTY, explicitCachingEnabled, explicitCachingEnabledSet, FAILOVER_RESTORE_AUTO, FAILOVER_RESTORE_LEVEL1, FAILOVER_RESTORE_LEVEL2, FAILOVER_RESTORE_NONE, FAILOVER_RESTORE_PROPERTY, FAILOVER_TYPE_AUTO, FAILOVER_TYPE_PROPERTY, FAILOVER_TYPE_TRANSACTION, IGNORE_AC_CONTEXT_PROPERTY, implicitCachingEnabled, implicitCachingEnabledSet, INITIATION_TIMEOUT_PROPERTY, isAutoACEnabled, isFirstConnection, isOracleDataSource, isReplayInDynamicMode, isStateRestorationAuto, isTransactionReplayEnabled, loginTimeout, logWriter, maxStatements, maxStatementsSet, networkProtocol, password, portNumber, RECONNECT_DELAY_PROPERTY, RECONNECT_RETRIES_PROPERTY, reconnectDelay, reconnectRetries, replayInitiationTimeout, REQUEST_SIZE_LIMIT_PROPERTY, serverName, serviceName, SESSION_STATE_CONSISTENCY_STATIC, SESSION_STATE_PROPERTY, stateRestorationType, tnsEntry, TRACE, url, user
CONNECTION_PROPERTIES, DATA_SOURCE_NAME, DATABASE_NAME, DESCRIPTION, EXPLICIT_CACHING_ENABLED, IMPLICIT_CACHING_ENABLED, MAX_STATEMENTS, NETWORK_PROTOCOL, PASSWORD, PORT_NUMBER, ROLE_NAME, SERVER_NAME, URL, USER
Constructor and Description |
---|
OracleXADataSourceImpl() |
createXAConnectionBuilder, debug, getXAConnection, getXAConnection, getXAConnection
getConnectionDuringExceptionHandling, setURL
createPooledConnectionBuilder, getConnection, getConnection, getConnection, getPhysicalConnection, getPhysicalConnection, getPhysicalConnection, getPhysicalConnection, getPhysicalConnection, getPooledConnection, getPooledConnection
addRefProperties, cleanup, clearDoneDumpOnMemoryPressure, clearReplayStatistics, createConnectionBuilder, enableACAndProxifyIfNecessary, getConnection, getConnection, getConnectionInitializationCallback, getConnectionNoProxy, getConnectionProperties, getConnectionProperty, getDatabaseName, getDataSourceName, getDescription, getDriverType, getExplicitCachingEnabled, getImplicitCachingEnabled, getLoginTimeout, getLogWriter, getMaxStatements, getMonitorLock, getNetworkProtocol, getParentLogger, getPassword, getPhysicalConnection, getPortNumber, getProxyFactory, getReference, getReplayStatistics, getReplayStatisticsString, getRequestSizeLimit, getRoleName, getServerName, getServiceName, getSystemProperty, getTNSEntryName, getURL, getUser, isWrapperFor, makeURL, registerConnectionInitializationCallback, registerMBean, setConnectionProperties, setConnectionProperty, setDatabaseName, setDataSourceName, setDescription, setDriverType, setExplicitCachingEnabled, setHostnameResolver, setImplicitCachingEnabled, setLoginTimeout, setLogWriter, setMaxStatements, setNetworkProtocol, setPassword, setPortNumber, setRoleName, setServerName, setServiceName, setSingleShardTransactionSupport, setSSLContext, setTNSEntryName, setTokenSupplier, setupACSpecificProperties, setUser, trace, unregisterConnectionInitializationCallback, unregisterMBean, unwrap, updateReplayStatistics
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPooledConnection
createPooledConnectionBuilder
clearDoneDumpOnMemoryPressure, getConnectionNoProxy, getProxyFactory, getReplayStatisticsString, getRequestSizeLimit, updateReplayStatistics
clearReplayStatistics, getConnectionInitializationCallback, getExplicitCachingEnabled, getImplicitCachingEnabled, getMaxStatements, getReplayStatistics, getRoleName, registerConnectionInitializationCallback, setExplicitCachingEnabled, setImplicitCachingEnabled, setMaxStatements, setRoleName, unregisterConnectionInitializationCallback
createConnectionBuilder, setExecutorService
getConnection, getConnection
isWrapperFor, unwrap
getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriter
public OracleXADataSourceImpl() throws SQLException
SQLException