tyrex.resource.jdbc.xa
public interface TwoPhaseConnection
TwoPhaseConnection is used as part of the two phase commit protocol to determine whether the transaction can commit or must rollback. Failure to implement this method will cause all connections to vote for commit, whether or not they can actually commit, leading to mixed heuristics.
TwoPhaseConnection allows the SQL begin/commit/rollback commands to be disabled for the duration of a transaction managed through an javax.transaction.xa.XAResource, preventing the application from demarcating transactions directly.
TwoPhaseConnection is used to tell if an exception thrown by the connection is fatal and the connection should not be returned to the pool.
Version: 1.0
Method Summary | |
---|---|
void | enableSQLTransactions(boolean flag)
Enables or disables transaction demarcation through SQL commit
and rollback. |
boolean | isCriticalError(SQLException except)
Returns true if the error issued by this connection is a
critical error and the connection should be terminated.
|
boolean | prepare()
Called to prepare the transaction for commit. |
Parameters: flag True to enable SQL transactions (the default)
Parameters: except The exception thrown by this connection
Returns: True if can commit, false if read-only
Throws: SQLException If transaction has been marked for rollback or cannot commit for any reason