What are the benefits of using a transaction to group database operations together that need to either all complete or be rolled back so none of them complete?
What are the benefits of using a transaction to group
When any bank / financial institution processes a transfer of money from one account to another account, the operations involved are always (1) to subtract a given amount of money from the source account and (2) add that same amount of money to the destination account. They have to be sure the software doing the transfer groups the above 2 required database operations in a transaction to ensure that if there is any system error/problem during these operations there is no way that money could be accidentally subtracted from an account but not added to the account it is supposed to be transferring to or customers will be very upset at the loss of money!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps