The ROLLBACK statement rolls back uncommitted changes made to the database through an individual run unit or through all database sessions associated with a task. A task-level rollback also backs out all uncommitted changes made in conjunction with scratch, queue, and print activity.
Whether the changes are automatically backed out depends on the execution environment:
In these cases, the ROLLBACK statement causes the affected areas to remain locked against subsequent access by other database sessions. They must be manually recovered. If changes cannot be backed out and CONTINUE was specified on the rollback request, a non-zero error status is returned to the application and if the request was for an individual run unit, that run unit is terminated.
Note: For more information about manual recovery, see the CA IDMS Database Administration Guide.
If CONTINUE is not specified, run units (and SQL sessions) impacted by the ROLLBACK statement end, and their access to the database is terminated. If CONTINUE is specified, impacted database sessions remain active after the operation is complete.
The ROLLBACK statement is used in both the navigational and logical record facility environments. The ROLLBACK TASK statement is also used in an SQL programming environment.
Currency
Following a ROLLBACK statement, all currencies are set to null. Unless the CONTINUE option is specified, the issuing program or task cannot perform database access through an impacted run unit without executing another BIND/READY sequence.
►►─── ROLLBACK ─┬────────┬─┬──────────────┬─ ; ───────────────────────────────►◄ └─ TASK ─┘ └─ (CONTINUE) ─┘
Rolls back the uncommitted changes made by all scratch, queue, and print activity and all top-level run units associated with the current task and terminates those run units. Its impact on SQL sessions associated with the task depends on whether those sessions are suspended and whether their transactions are eligible to be shared.
More information:
For more information about the impact of a ROLLBACK TASK statement on SQL sessions, see the CA IDMS SQL Programming Guide.
For more information about run units and the impact of ROLLBACK TASK, see the CA IDMS Navigational DML Programming Guide.
Central version only. Causes the affected run units and SQL sessions to remain active after their changes are backed out. Database access can be resumed without reissuing BIND and READY statements.
Note: The CONTINUE option should not be used in local mode if database changes have been made.
The following statement reverses the effects of the run unit through which it is issued and terminates the run unit:
ROLLBACK;
Upon completion of the ROLLBACK function, the ERROR_STATUS field in the IDMS DB communications block indicates the outcome of the operation:
The request has been serviced successfully.
CONTINUE was specified and database changes could not be backed out. The run unit has been terminated.
The specified request is invalid; the program may contain a logic error.
TASK CONTINUE was specified and database changes could not be backed out.
An error was encountered processing a syncpoint request; check the log for details.
|
Copyright © 2014 CA.
All rights reserved.
|
|