Class TxnFailureReport

java.lang.Object
com.github.sttk.sabi.TxnFailureReport

public class TxnFailureReport extends Object
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 Details

    • dataConnName

      public final String dataConnName
      The logical name of the data connection.
    • dataConnType

      public final String dataConnType
      The class name or type of the data connection.
    • cause

      public final TxnFailureCause cause
      The cause of the transaction failure associated with this connection.
    • rollback

      public final TxnFailureRollback rollback
      The rollback outcome associated with this connection.
  • Constructor Details

    • TxnFailureReport

      public TxnFailureReport(String name, String type, TxnFailureCause cause, TxnFailureRollback rollback)
      Constructs a new TxnFailureReport with the specified connection details, cause, and rollback outcome.
      Parameters:
      name - the logical name of the data connection
      type - the class name or type of the data connection
      cause - the transaction failure cause
      rollback - the rollback outcome
  • Method Details

    • toString

      public String toString()
      Returns a string representation of this transaction failure report.
      Overrides:
      toString in class Object
      Returns:
      a formatted string containing connection details, cause, and rollback outcome
    • isCauseOfFailure

      public boolean isCauseOfFailure()
      Determines whether this connection was a direct cause of the transaction failure.
      Returns:
      true if this connection caused the failure; false if the cause state is NoneByCommitted or NoneByUncommitted
    • recoveryForCommit

      public TxnFailureRecovery recoveryForCommit()
      Determines the recommended recovery strategy if the intent is to re-attempt and complete the transaction commit.
      Returns:
      the recommended TxnFailureRecovery action for committing
    • recoveryForRollback

      public TxnFailureRecovery recoveryForRollback()
      Determines the recommended recovery strategy if the intent is to cancel and roll back the transaction.
      Returns:
      the recommended TxnFailureRecovery action for rolling back