Previous Topic: Locking a RowNext Topic: ANSI Compatibility


CICS Unit of Recovery End

If your plan is for a CICS application, CA Datacom CICS Services issues a CICS SYNCPOINT and issues either a COMIT or ROLBK to end the unit of recovery:

CA Datacom CICS Services does not issue a CICS SYNCPOINT and does not issue a COMIT or ROLBK to end the unit of recovery when:

However, the SQL Manager automatically ends a unit of recovery after each SQL statement if there are:

For example, if ISOLEVEL=U and you have only SELECT INTO statements or no open cursors, you need not execute a COMMIT WORK statement at CICS transaction end because there is no current unit of recovery active.

The only case where the unit of recovery is left active when the synchronous CICS task ends successfully is therefore when ISOLEVEL=U and a cursor is left open.

Note: If you code ISOLEVEL=U, you are responsible for ending the current unit of recovery as follows:

When you do not do one of the previously given actions and the current unit of recovery remains active, it allows a browse application to keep cursors open across CICS synchronous transactions. Be aware, however, that if that was not what you intended, the plan stays locked in share mode, and memory is held in the Multi-User Facility until the unit of recovery is ended.

For example, if your application opens a cursor, fetches one or more rows, and issues a CICS read with return to the application, upon return your application receives a -135 SQLCODE (INVALID CURSOR STATE) when it attempts to open the cursor, because it was left open from the previous CICS transaction. Or, if the next application attempts to execute a plan with ISOLEVEL=C, your application receives a -144 SQLCODE (INVALID TRANSACTION ISOLEVEL) because you cannot mix transaction isolation levels in the same unit of recovery.

To end the current unit of recovery, have your application issue a ROLLBACK WORK or CICS SYNCPOINT when it receives an unexpected SQLCODE, or you can execute a non-SQL command which ends the current unit of recovery. Otherwise, you must close the SQL User Requirements Table to end the current unit of recovery.

If your application does not execute CICS RETURN with the same transaction ID, the current unit of recovery is ended, that is to say, the unit of recovery is ended if control is passed to another transaction or back to CICS.