Header Ads

ad

Spring Transaction Management

What is Transaction Management?

The process of combining related operations into single unit and executing them by applying "do everything or nothing" principle is called Transaction Management.

Do everything or nothing principle states if all operations are successful, commit the transaction(do everything). 

If any of the operation is failed, rollback the entire transaction(do nothing).

Ex:- Money Tranfer operation from one account to another...




All above 5 operations are related means used to perform single operation, that is money transfer from Account A to Account B....


Transaction Management allows to implement ACID properties?

  • A--->Atomocity
  • C--->Consistency
  • I--->Isolation
  • D--->Durability

Atomocity

The process of combining multiple related operations into single unit is called Atomicity..

Consistency

Even though rules are kept on DB software(like balance must not be negative) are violated during the course of transaction management, but if there is a guarantee that no rule will be violated at the end of the transaction then we can say DB is consistent...

Isolation

There may be many transaction processing with same data set at the same time. Each transaction should be isolated from others to prevent data corruption.

Durability

Once a transaction has completed, the results of this transaction have to be made permanent and cannot be erased from the database due to system failure.







No comments