Reputation: 86
I am using MySQL Database for my Java Application. I am using Transactions. I am curious about what happens when machine shutdowns suddenly in between Transaction. Is it rolled back when server started or anything else happens.
Upvotes: 1
Views: 807
Reputation: 438
Quote from Greg Kemnitz:
Yes, “mid-transaction” operations are effectively ROLLBACK’d - and their changes undone when the server comes back up - while transactions that execute their COMMIT statement before the shutdown thread hits them will COMMIT.
Note that this only applies for storage engines such as InnoDB or XtraDB that support transactions. Behavior in this situation is undefined for MyISAM as it doesn’t support transactions.
Original post:
Upvotes: 1