Icon

13_DBTransactionExample

Working with Database Transactions

The DB Transaction Start and DB Transaction End nodes allow you to model a database transaction, i.e. a unit of work that is either completely processed or not at all. So, if all nodes between the DB Transaction Start and DB Transaction End nodes execute successfully, all changes will be persisted in the database. Likewise, if any of the nodes between the two transaction nodes fails, none of the changes will be persisted in the database.

Note that most databases do an implicit commit when executing a DDL statement such as create or drop table even within a transaction.


Annotations and comments
  • This workflow demonstrates how to use the DB Transaction Start and DB Transaction End nodes to perform database transaction. For more information see the workflow metadata. Find it here: View -> Description.
  • All DB commands between the DB Transaction Start and DB Transaction End nodes will be executed within the same database transaction. So either all succeed or none.
  • Fails due to duplicate key
  • Execute DDL nodes outside the transaction since in most databases they cause a commit!
  • Output ports: 1: DB Connection (always active) 2: Flow Variable (active on success) 3: Folw Variable (active on failure)
  • Workflow name
  • Send email on failure (needs configuration)

Nodes

Extensions

Links