Commit and rollback
Making a set of changes permanent together, or undoing them together, so a transaction never half-happens.
Also written unit of work, syncpoint, two-phase commit
A transfer between two accounts involves two changes: money out of one, money into the other. If the system failed between them, one account would be wrong. Commit and rollback exist so that cannot happen.
Changes are grouped into a unit of work. At the end, the transaction either commits, making every change in the unit permanent together, or rolls back, undoing all of them as if none had occurred. There is no in-between state, even if the system fails midway. Recovery on restart completes or reverses the unit.
In CICS, a transaction ending normally commits automatically, and a program can also commit part way through to start a fresh unit of work, or explicitly back out. In batch, programs handling large volumes usually commit periodically rather than at the very end, so a failure does not discard hours of work and a restart can resume from the last commit point.
When more than one resource is involved, a database and a queue for example, a two-phase protocol coordinates them so they agree.
Related terms
- CICS transactionOne unit of online work in CICS: the whole exchange of receiving a request, doing the work, and sending a response.
- CICSThe transaction manager that runs online mainframe applications, and the software behind a great many screens bank staff use.
- DB2 for z/OSIBM's relational database on the mainframe, where a great deal of the world's banking and insurance data is stored.
- Online transaction processingHandling many small pieces of work in real time while someone waits: a card payment, a balance check, a seat booking.
- Batch processingRunning work in bulk, without anyone watching, usually on a schedule. The overnight run that settles a day of transactions.