The Canonical Transaction Example Is Flawed

Monday, February 28, 2005

Almost every article ever written about database transactions includes the example of an ATM machine dispensing money. The articles will describe how the bank uses a transaction to prevent people from overdrawing the account during simultaneous access, or how the bank can rollback a transaction if an error occurs at the ATM.

They are all wrong.

About 7 years ago I went to a local ATM, punched in my PIN, and asked the ATM to withdraw $80 from my account. The machine thought about the request for a bit, and then started to make the happy fluttering noise ATM machines will do just before delivering cash. The happy fluttering noise was followed by a fateful POP sound in the distance, and then a total blackout. Power failure.

When power came back seconds later I still had no money, and the ATM had an OS/2 boot screen.

Cool! I remember thinking. The bank’s database just rolled back my transaction! I drove off in search of a working machine. Of course I was a bit younger then and had not learned the secret mission statement of every major financial institution: “Customer inconvenience is our first priority”. When my bank statement arrived the next month I was genuinely surprised to see the bank had committed the $80 transaction against my account.

One might think ATM machines would be equipped with some sort of UPS to keep them running in the event of a power failure during an open transaction, but one would be forgetting the second mission statement of all financial institutions: “Mistakes are acceptable, as long as we screw the customer and not ourselves”.

For the curious, here is how the story ends.

A month later I went to the bank, approached a teller, and told her if she gave me $80 in unmarked bills nobody would get hurt.

Well, not really, but it felt that way.

I showed the teller my statement and told her my story. She asked me to stand by a door to the left and walked through a back door behind the counter.

While waiting in the lobby I thought about the possibility of the teller returning to tell me the bank records were never wrong. Not only would I not get my $80 back, but they’d deduct a $10 service fee for seeing me in person. I’m always optimistic like that when dealing with banks. Thieves.

I was surprised when a woman burst out from the door beside the counter, ran over and practically hugged me. The bank had noticed an $80 discrepancy in the ATM records and this lady’s sole purpose was to find out what happened. I made her day and got my money back.

The End.


Comments
haacked@gmail.com (Haacked) Monday, February 28, 2005
I was wondering about not too long ago. A little while ago while I was entering my PIN, the ATM just went blank. Turns out that a worker in the back had turned it off while I was using it as they were about to close down and she didn't notice me.
<br>
<br>I started wondering at what point does the transaction get committed. There has to be the point of no return point where the money is not yet in your hands yet the transaction is committed from the bank's point of view.
<br>
<br>Luckily they do try to reconcile the transaction, thus creating a sort of distributed (non-automated) transaction. ;)
Sahil Malik Monday, February 28, 2005
My 3 favorite words - &quot;Please Take Cash&quot;.
<br>
<br>Too bad you didn't see 'em then :).
Bill Wednesday, March 9, 2005
My mind is in the gutter, when you said ATM, I was thinking www.atmbabes.com
Comments are now closed.
by K. Scott Allen K.Scott Allen
My Pluralsight Courses
The Podcast!