Transaction — Reference
Execute related database work within one connection’s transaction.
Execute related database work within one connection’s transaction.
Before you begin
Section titled “Before you begin”- A working database connection and a disposable test table or records. Validate inputs and enforce access before private reads or writes.
Transaction
Section titled “Transaction”Execute related database work within one connection’s transaction.
Settings
Section titled “Settings”| Setting | Meaning |
|---|---|
| Name | The step name used by later server expressions and named action output. For example, a query named products is available to subsequent steps as products. |
| Output | Includes the named result in the action response. The result can be used by later server steps when Output is off. Several rules initialize Output on although their declared default is false; inspect the saved action. |
| Connection | The database connection definition to use. It must be available and correctly configured for the active target. |
| exec | The child database steps to run within the selected connection’s transaction. |
Worked example
Section titled “Worked example”In a disposable database, perform two related inserts inside the transaction. Test success, then deliberately cause the second operation to fail and verify that the first write is rolled back. Confirm the steps use the transaction’s selected connection.
Result and safety boundaries
Section titled “Result and safety boundaries”Transactions apply to the participating database work, not uploaded files, email or remote API calls. Keep response-ending steps outside the transaction. Catching an error inside the transaction and swallowing it can make the outer callback appear successful and allow a commit. Do not assume Name/Output creates a portable named response wrapper for this transaction; return the intended nested results explicitly afterward.
Use the database workflow
Section titled “Use the database workflow”Use Database Manager to define and inspect the underlying tables. Use Server Connect to control the data returned to the page, and verify the actual response shape before choosing an App Connect binding.
Check your result
Section titled “Check your result”You can configure the intended query/write scope and verify its result shape or database effect.