MashZone NextGen 10.2 | Appendix | Legacy Presto components | Mashables and Mashups | Mashups in EMML | Writing Mashups in EMML | Controlling Mashup Processing Flow | SQL Transactions
 
SQL Transactions
 
<sqlBeginTransaction>
<sqlCommit>
<sqlRollback>
You can add standard transaction handling for SQL commands invoked in a mashup script or for MashZone NextGen database mashables created in version 3.0 or later using these statements:
*<sqlBeginTransaction>: opens a connection to the default datasource or the datasource specified in the statement and sets AutoCommit to false.
*<sqlCommit>: sends a commit message to the default datasource or the datasource specified in the statement and closes the database connection.
*<sqlRollback>: sends a rollback message to the default datasource or the datasource specified in the statement and closes the database connection. The MashZone NextGen Server also automatically sends a rollback for any SQL invocation failures for the specified datasource within the bounds of the transaction.
Note: The MashZone NextGen Server does not support distributed transactions. These statement only affect the invocations for a specific datasource. All other statement are unaffected, including SQL commands to other datasources.
Transaction Example and Working Samples
...
<sqlBeginTransaction name="hr"/>
<sqlUpdate name="hr" statement="insert into
dept(dept_id, name, region)
values('15', 'Analysis', 'SouthWest')"
outputvariable="$deptInsert"/>
<sqlUpdate name="hr" statement="insert into
jobs(job_id, title, dept, grade)
values('344', 'Analysis Manager', 'Analysis', 'G12')"
outputvariable="$jobInsert"/>
<sqlUpdate name="hr" statement="insert into
jobs(job_id, title, dept, grade)
values('345', 'Technical Advisor', 'Analysis', 'G15')"
outputvariable="$jobInsert"/>
<sqlCommit name="hr"/>
...
For a working sample mashup, see the DatabaseSample (sql.emml). See Mashup Samples for a list of MashZone NextGen mashup samples and where to find them.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release