Difference between revisions of "Transaction Control Nodes"

From PresenceWiki
Jump to: navigation, search
 
(")
Line 1: Line 1:
 +
== Transaction Control Nodes ==
 +
 
'''Transaction Control Nodes''' provide a mechanism to roll back database transactions following an error or unexpected conditions, or to commit outstanding transactions following successful completion of other criteria.
 
'''Transaction Control Nodes''' provide a mechanism to roll back database transactions following an error or unexpected conditions, or to commit outstanding transactions following successful completion of other criteria.
  
To roll back outstanding transactions, just join a "RollBack Updates" node to your Task.
+
Typically these will be combined with an [[Error Handler]], as with the example Task below:
 +
 
 +
http://www.international-presence.com/wikidocs/images/transaction_nodes.png
 +
 
 +
This Task schematic describes how to handle the following situation:
 +
 
 +
# "Update Table 1" succeeds
 +
# "Update Table 2" succeeds
 +
# "Update Table 3" fails
  
To commit outstanding transactions, join a "Commit Updates" node to your Task.
+
In this instance we want to rollback the updates performed by "Update Table 1" and "Update Table 2", which is performed by the Rollback Node after catching the error generated by "Update Table 3". Similarly, if "Update Table 2" fails, updates performed by "Update Table 1" will be rolled back. Only if all three SQL statements succeed will the changes be committed.
  
Simples!
+
'''Note:''' Commit and Rollback nodes will only take effect if "Commit transactions later in Task" is selected under "Transaction Options" on the SQL Editor.

Revision as of 16:03, 13 April 2010

Transaction Control Nodes

Transaction Control Nodes provide a mechanism to roll back database transactions following an error or unexpected conditions, or to commit outstanding transactions following successful completion of other criteria.

Typically these will be combined with an Error Handler, as with the example Task below:

http://www.international-presence.com/wikidocs/images/transaction_nodes.png

This Task schematic describes how to handle the following situation:

  1. "Update Table 1" succeeds
  2. "Update Table 2" succeeds
  3. "Update Table 3" fails

In this instance we want to rollback the updates performed by "Update Table 1" and "Update Table 2", which is performed by the Rollback Node after catching the error generated by "Update Table 3". Similarly, if "Update Table 2" fails, updates performed by "Update Table 1" will be rolled back. Only if all three SQL statements succeed will the changes be committed.

Note: Commit and Rollback nodes will only take effect if "Commit transactions later in Task" is selected under "Transaction Options" on the SQL Editor.