Search code examples
databasetransactionsoperating-systemcommitabort

What is the meaning of "commit" and "abort" in a transaction?


I am new to distributed technology. I always see these two words with transactions, but I cannot find definition on google.

Can anyone please help to explain them?


Solution

  • Commit simply means to permanently save all the changes which you have made in the current transaction. And, Abort means to disrupt the action by killing the current ongoing transaction. Generally, a term Rollback is used which refers to reverting to a previous stable state in the case of transactions.

    Suppose, I am booking a ticket and in case the whole process is successfully done, then the server commits the transaction on a whole. Else,if there is any problem like power failure or any other problem, then your process is aborted and return backs to a previously created stable state.

    I hope this helps. Feel free to comment if you couldn't understand further!