Integrate Software AG Products Using Digital Event Services 10.4 | Integrate Software AG Products Using Digital Event Services | MashZone NextGen Help | Appendix | Legacy Presto components | Mashables and Mashups | Mashups in EMML | Writing Mashups in EMML | Controlling Mashup Processing Flow | Database Mashable Transactions
 
Database Mashable Transactions
For database mashables created in MashZone NextGen 2.7.0 or earlier, you can add transaction handling using these MashZone NextGen extension statements:
*<presto:beginTransaction>: opens a connection to the database associated with the mashable specified in the command and sets AutoCommit to false.
*<presto:commitTransaction>: sends a commit message to the database associated with the mashable specified in the command and closes the database connection.
*<presto:rollbackTransaction>: sends a rollback message to the database associated with the mashable specified in the command and closes the database connection. The MashZone NextGen Server also automatically sends a rollback for any invocation failures for the specified Database service within the bounds of the transaction.
Important: For transaction handling for database mashables created in later versions of MashZone NextGen, see SQL Transactions.
The MashZone NextGen Server does not support distributed transactions. These commands only affect the invocations for a specific database mashable. All other commands are unaffected, including invocations of other services.
Transaction Example
This sample uses a database mashable with operations to insert, update or delete records in several Personnel tables.
...
<presto:beginTransaction service="personnel"/>
<invoke service="personnel" operation="addEmployee"
inputvariables="newEmployee" outputvariable="employeeResult"/>
<invoke service="personnel" operation="addDemographics"
inputvariables="newEmployee" outputvariable="$demoResult"/>
<invoke service="personnel" operation="addBenefits"
inputvariables="newEmployee" outputvariable="$benefitsResult"/>
<if condition="$employeeResult/response/response/errorcode = 300
or $demoResult/response/response/errorcode = 300
or $benefitsResult/response/response/errorcode = 300">
<presto:rollbackTransaction service="personnel"/>
<else>
<presto:commitTransaction service="personnel"/>
</else>
</if>
...

Copyright © 2019 | 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