Skip to main content

Start Transaction

Starts a new PostgreSQL transaction.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Connection Id - The unique identifier of the database connection to use for the transaction.

Options

  • None

Output

  • Transaction Id - A unique identifier for the started transaction.

How It Works

The Start Transaction node begins a new PostgreSQL transaction using the provided connection ID. When executed, the node:

  1. Validates the provided connection ID and retrieves the connection
  2. Begins a new transaction on the connection
  3. Generates a unique transaction ID
  4. Stores the transaction in an internal transactions dictionary
  5. Returns the transaction ID as output

Requirements

  • A valid PostgreSQL connection must be established
  • The connection ID must be valid and correspond to an active connection

Error Handling

The node will return specific errors in the following cases:

  • Connection Id not found in the connections dictionary
  • Failed to add transaction due to a duplicate GUID (very unlikely)

Usage Notes

  • The transaction ID should be stored and used in subsequent database operations that should be part of the transaction
  • Transactions should be committed using the Commit Transaction node or rolled back using a rollback mechanism
  • All operations between Start Transaction and Commit Transaction/Rollback will be part of the same transaction
  • Transactions help ensure data consistency and can be rolled back in case of errors