Class TxnFailureReport
java.lang.Object
com.github.sttk.sabi.TxnFailureReport
Contains transaction failure diagnostic information and rollback status for a specific data
connection.
Instances of this class are created during transaction failure processing in DataHub
and passed to DataConn.onTxnFailure(AsyncGroup, java.util.List). It details the
connection's name, type, failure cause (TxnFailureCause), and rollback status (TxnFailureRollback), and provides methods to determine recommended recovery strategies.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal TxnFailureCauseThe cause of the transaction failure associated with this connection.final StringThe logical name of the data connection.final StringThe class name or type of the data connection.final TxnFailureRollbackThe rollback outcome associated with this connection. -
Constructor Summary
ConstructorsConstructorDescriptionTxnFailureReport(String name, String type, TxnFailureCause cause, TxnFailureRollback rollback) Constructs a newTxnFailureReportwith the specified connection details, cause, and rollback outcome. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether this connection was a direct cause of the transaction failure.Determines the recommended recovery strategy if the intent is to re-attempt and complete the transaction commit.Determines the recommended recovery strategy if the intent is to cancel and roll back the transaction.toString()Returns a string representation of this transaction failure report.
-
Field Details
-
dataConnName
The logical name of the data connection. -
dataConnType
The class name or type of the data connection. -
cause
The cause of the transaction failure associated with this connection. -
rollback
The rollback outcome associated with this connection.
-
-
Constructor Details
-
TxnFailureReport
public TxnFailureReport(String name, String type, TxnFailureCause cause, TxnFailureRollback rollback) Constructs a newTxnFailureReportwith the specified connection details, cause, and rollback outcome.- Parameters:
name- the logical name of the data connectiontype- the class name or type of the data connectioncause- the transaction failure causerollback- the rollback outcome
-
-
Method Details
-
toString
-
isCauseOfFailure
public boolean isCauseOfFailure()Determines whether this connection was a direct cause of the transaction failure.- Returns:
trueif this connection caused the failure;falseif the cause state isNoneByCommittedorNoneByUncommitted
-
recoveryForCommit
Determines the recommended recovery strategy if the intent is to re-attempt and complete the transaction commit.- Returns:
- the recommended
TxnFailureRecoveryaction for committing
-
recoveryForRollback
Determines the recommended recovery strategy if the intent is to cancel and roll back the transaction.- Returns:
- the recommended
TxnFailureRecoveryaction for rolling back
-