TAGS :Viewed: 2 - Published at: a few seconds ago

[ sql interrupted transaction ]

I have a question. Lets imagine situation when client wants to use bank ATM and request money count. But suddenly ATM is down because of power failure. What will be with DB and transaction? I am familiar with ACID of transaction. But actually how DB knows that ATM is no more alive? Timeouts or what? Let it be MySQL as DB with InnoDB.

Answer 1


The database processes the request sent to it and reports whatever results for that request - in your case the money count - and will be done with it. Once the result is handed back to the process which is waiting for the result, there ends the responsibility of the database.

Its the headache of the worker process to get the result back to the ATM and show it to the user. If the ATM is down, the request will be void - lets say it will eventually gets timed out. Whoever designed the process will have to take care of the state where the ATM machine is down.