Teradata Database Synchronization Strategy - IBM CICS Interface for Teradata

IBM CICS Interface for Teradata Reference

Product
IBM CICS Interface for Teradata
Release Number
15.00
Language
English (United States)
Last Update
2018-09-25
dita:id
B035-2448
lifecycle
previous
Product Category
Teradata Tools and Utilities

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:

  • A BEGIN TRANSACTION should be issued ahead of any Teradata SQL statement that performs an update.
  • The END TRANSACTION statement should be issued immediately before the CICS RETURN command.
  • An END TRANSACTION must be issued immediately following the CICS SYNCPOINT command. This command ensures that both CICS and the Teradata Database roll back their resources if the program abends during syncpoint processing.
  • Do not allow an END TRANSACTION statement to appear before the SYNCPOINT statement. The Teradata Database will commit its changes, but then cannot roll them back if the SYNCPOINT fails.
  • A time window exists after the CICS SYNCPOINT command finishes and END TRANSACTION statement processing begins. If a Teradata Database failure occurs during this period, CICS and Teradata resources may not be synchronized.
  • The ABORT request may be sent either before or after the EXEC CICS SYNCPOINT ROLLBACK command. If CICS fails during rollback processing, an ABORT request is sent automatically to the Teradata Database.
  • The ABORT request may be sent to the Teradata Database before the EXEC CICS ABEND command. An ABORT request is sent automatically to the Teradata Database if the CICS transaction abends.
  • If BEGIN TRANSACTION has been sent and the CICS transaction ends before an END TRANSACTION successfully finishes, the Teradata Database will roll back the changes.
  • If BEGIN TRANSACTION has been sent and LOGOFF occurs with END TRANSACTION, the Teradata transaction is rolled back.
  • 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.