Skip to main content

Roll Back Transaction

AutomatR.MySQLDataBase.RollBackTransaction

The "Roll Back Transaction" activity in AutomatR for MySQL databases is designed to roll back a transaction initiated by the "Start Transaction" activity. This activity is crucial for ensuring data consistency and integrity by reverting changes made during the transaction in case of errors or unforeseen circumstances.

Properties

NameDescription
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Roll Back Transaction" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.

How to use:

  1. Drag and drop the "Roll Back Transaction" activity onto the workflow.
  2. Optionally, configure the delay for synchronization purposes.
  3. Ensure that the "Roll Back Transaction" activity is placed within the scope of a "Start Transaction" activity to properly handle the rollback operation.

Example: Consider an example where a series of database operations are performed within a transaction using the "Start Transaction" activity. In the event of an error, the "Roll Back Transaction" activity is used to revert the changes made during the transaction:

Start Transaction:
Connection: MySqlConnectionVariable
Transaction: TransactionVariable
Data: TransactionDataDictionary

... Perform database operations within the transaction ...

If Error Occurs:
Roll Back Transaction:
Delay: 0

In this example, the "Roll Back Transaction" activity is placed within the error-handling path of the workflow. If an error occurs during the transaction, the "Roll Back Transaction" activity is executed with a delay of 0 seconds to promptly roll back the changes made within the transaction, ensuring data consistency.