Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 10: CICS Transaction Processing


Synchronization

Synchronization makes a group of updates succeed or fail together as one unit of work.

EXEC CICS SYNCPOINT commits the unit of work; SYNCPOINT ROLLBACK undoes it.

What is a unit of work

  • A unit of work is the set of recoverable changes made since the last syncpoint, or since the task started.
  • Recoverable resources include VSAM files, DB2 tables, temporary storage queues, and transient data.
  • At syncpoint CICS uses two-phase commit so that all resources agree on commit or backout together.
  • If the task abends, CICS automatically backs out the incomplete unit of work.

SYNCPOINT

  • EXEC CICS SYNCPOINT ends the current unit of work and starts a new one.
  • All updates since the last syncpoint are committed and made permanent.
  • Locks and enqueues held by the task are released at syncpoint.
  • Issue syncpoints at business boundaries, for example after one complete order is processed.

ROLLBACK

  • EXEC CICS SYNCPOINT ROLLBACK backs out every change in the current unit of work.
  • Use it when validation fails after updates were already made.
  • After rollback the program can display an error and continue, or end the task.
  • Never issue updates you cannot afford to lose before you decide whether to roll back.

Example of SYNCPOINT and ROLLBACK

  • Commit when the order is complete; back out when validation fails.
  • *--- commit the completed order --- EXEC CICS SYNCPOINT END-EXEC. *--- back out when validation fails --- IF WS-VALIDATE-FAILED EXEC CICS SYNCPOINT ROLLBACK END-EXEC END-IF.
  • After the rollback the file looks exactly as it did at the previous syncpoint.





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant