tyrex.resource.jdbc.xa
public abstract class XADataSourceImpl extends Object implements DataSource, ConnectionPoolDataSource, XADataSource, Serializable, Runnable
Version: 1.0
Field Summary | |
---|---|
static int | DEFAULT_ISOLATION_LEVEL
The default isolation level is Read Committed |
static int | DEFAULT_TX_TIMEOUT
The default timeout for all new transactions is 10 seconds. |
Constructor Summary | |
---|---|
XADataSourceImpl()
Implementation details:
If two XAConnections are associated with the same transaction
(one with a start the other with a join) they must use the
same underlying JDBC connection. |
Method Summary | |
---|---|
void | debug(PrintWriter writer) |
boolean | getIgnoreIsolationLevel()
Return true if the isolation level is ignored so that the
isolation level is never set on the underlying JDBC connection.
|
int | getIsolationLevel()
Returns the transaction isolation level to use with all newly
created transactions. |
abstract PrintWriter | getLogWriter()
This method is defined in the interface and implemented in the
derived class, we re-define it just to make sure it does not
throw an SQLException and that we do not need to
catch one. |
PooledConnection | getPooledConnection() |
PooledConnection | getPooledConnection(String user, String password) |
float | getPruneFactor()
Get the factor that specifies the number of
connections that are released from the pool.
|
int | getTransactionTimeout()
Returns the default timeout for all transactions.
|
TxConnection | getTxConnection(Xid xid)
Returns an underlying connection for the global transaction,
if one has been associated before.
|
Xid[] | getTxRecover()
XXX Not fully implemented yet and no code to really
test it. |
XAConnection | getXAConnection() |
XAConnection | getXAConnection(String user, String password) |
Connection | newConnection(String userName, String password)
Creates a new underlying connection. |
void | releaseConnection(Connection conn, String userName, String password)
Release an unused connection back to the pool. |
void | run() |
void | setIgnoreIsolationLevel(boolean ignoreIsolationLevel)
Tell the data source whether to ignore the isolation level on the
underlying JDBC connection. |
void | setIsolationLevel(int isolationLevel)
Set the transaction isolation level to use with all newly
created transactions. |
void | setPruneFactor(float pruneFactor)
Set the factor that specifies the number of
connections that are released from the pool.
|
void | setTransactionTimeout(int seconds)
Sets the default timeout for all new transactions. |
TxConnection | setTxConnection(Xid xid, TxConnection txConn)
Associates the global transaction with an underlying connection,
or dissociate it when null is passed.
|
Returns: true if the isolation level is ignored
See Also: XADataSourceImpl XADataSourceImpl
Returns: the transaction isolation level to use with all newly created transactions
See Also: XADataSourceImpl XADataSourceImpl
Returns: the prune factor
Returns: the default timeout for all transactions.
Parameters: xid The transaction Xid
Returns: A connection associated with that transaction, or null
Parameters: userName the userName password the password
Returns: An open connection ready for use
Throws: SQLException An error occured trying to open a connection
Parameters: conn An open connection that is no longer in use userName the user name for the connection password the password for the connection
Parameters: ignoreIsolationLevel true if the isolation level is ignored
See Also: XADataSourceImpl XADataSourceImpl
The isolation level of java.sql.Connection.TRANSACTION_NONE is not supported.
Parameters: isolationLevel the new isolation level
Throws: IllegalArgumentException if the specified isolation level is not one of the following java.sql.Connection.TRANSACTION_READ_UNCOMMITTED, java.sql.Connection.TRANSACTION_READ_COMMITTED, java.sql.Connection.TRANSACTION_REPEATABLE_READ, java.sql.Connection.TRANSACTION_SERIALIZABLE
See Also: XADataSourceImpl XADataSourceImpl
Parameters: pruneFactor the prune factor. 0 <= pruneFactor <= 1
default timeout
.
Parameters: seconds The timeout in seconds
Parameters: xid The transaction Xid conn The connection to associate, null to dissociate