Teradata Database Synchronization Strategy
The Teradata SQL BEGIN TRANSACTION and END TRANSACTION statements define the beginning and end of a Teradata Database transaction.
Either all or none of the statements in a transaction delimited by the BEGIN/END TRANSACTION statements are committed.
If any of the statements in a transaction fails to execute, the changes are backed out and the database returns to the condition prior to issuing the BEGIN TRANSACTION statement.
Notice:
If a statement in a user-generated transaction fails and a Teradata Database rollback occurs, the application must not continue executing the subsequent statements that were part of that user‑generated transaction. Any requests issued outside a user generated transaction are treated as a transaction and are committed if they execute successfully. Therefore, the application must test the response to every request and implement special logic to handle failures that indicate rollback.
If a request to update data is made to the Teradata Database after a BEGIN TRANSACTION is issued and the CICS transaction fails, the update is automatically backed out.
This recovery occurs because the session is logged off before an END TRANSACTION statement is encountered and the transaction is not logically complete.
CICS backs out the resources that were specified for recovery and the Teradata Database rolls back any changes to the database.
The Teradata Database treats a single request, which may consist of multiple statements, such as UPDATE, as a transaction unless it is located within a matching pair of BEGIN TRANSACTION/END TRANSACTION statements.
A macro that contains several statements is also treated as a single Teradata Database transaction.
A matching BEGIN TRANSACTION/END TRANSACTION pair embedded within another such pair is equally acceptable.
Every BEGIN TRANSACTION statement, however, must correspond to an END TRANSACTION statement.
To synchronize Teradata tables and CICS resources, note the following requirements:
If a failure such as a program abend or CICS abend occurs, the host sends the Teradata Database an ABORT request for its current transaction. All sessions associated with CICS automatically log off.
A Teradata session may continue across CICS pseudo‑conversational task end, but CICS forces a sync point for its resources at task end.