Skip to content

BeginTransaction

This function creates a Transaction in its execution path that can be used by the SQLite ExecuteSQL function.

The transaction is automatically committed after all functions in the execution path complete.

If an error occurs, all SQL statements within the transaction are rolled back.

The connection string that specifies how to connect to the database.

Controls when SQLite acquires locks on the database file. The three options map directly to SQLite’s native BEGIN variants. Learn more

Isolation LevelLock acquiredOther connections can readOther connections can write
Deferred (Default)On first read or write✅ (until first write)
ImmediateOn transaction open (write lock)
ExclusiveOn transaction open (exclusive lock)

Suppose you have a sales order with multiple line items that need to be added to the database.

Using ExecuteSQL without BeginTransaction creates a new database connection for each item written. By using BeginTransaction, all items are added within the same transaction.

If an error occurs during order creation, the entire transaction is rolled back, ensuring no incomplete orders are stored in the database. Adding multiple records within the same transaction also significantly improves execution speed.

Steps:

  1. Add a BeginTransaction function to your Solution.
  2. Configure the Connection string.
  3. Add your ExecuteSQL functions to your workflow.
  4. For each ExecuteSQL, select the Use transaction property.
  5. Set the Transaction property (only displayed when Use transaction is selected) to ‘BeginTransaction.Transaction’.
Example of BeginTransaction