The bank said yes. Then the notes jammed.
transcript
The bank says yes. 1,000 rupees leave Asha's account. Then the notes jam. Nothing comes out.
Two steps: take the money, push out notes. Which goes first? Dispense first, and the debit can still fail. The cash is gone for good. Debit first, and the notes can jam. Also bad. But only this one is fixable. A debit can be reversed.
First, write the transaction to a journal. A power cut leaves a record. Then debit 1,000, with that transaction id. The motor jams. No notes presented. So reverse that id. The 1,000 goes back. Card returned.
The bank's ledger and a motor can't share a database transaction. So you undo the first when the second fails. A compensating transaction. Then the ATM goes out of service.
Check the ATM can make the amount. Before any money moves. Journal it. Then debit, with a transaction id. Dispense. If anything fails after the debit, reverse that id.
Debit before you dispense. A debit can be reversed. Cash can't.
Full breakdown in the lecture.