Unit of work in TSO
Applications that use the TSO attachment facility can explicitly define units of work by using the SQL COMMIT and ROLLBACK statements.
In TSO applications, a unit of work starts when the first updates
of a Db2 object occur. A unit
of work ends when one of the following conditions occurs:
- The program issues a subsequent COMMIT statement. At this point in the processing, your program has determined that the data is consistent; all data changes that were made since the previous commit point were made correctly.
- The program issues a subsequent ROLLBACK statement. At this point in the processing, your program has determined that the data changes were not made correctly and, therefore, should not be permanent. A ROLLBACK statement causes any data changes that were made since the last commit point to be backed out.
- The program terminates and returns to the DSN command processor, which returns to the TSO Terminal Monitor Program (TMP).
The first and third conditions in the preceding list are called a commit point. A commit point occurs when you issue a COMMIT statement or your program terminates normally.