DevShivmohan / Learning-everything

Learning for developer only
0 stars 1 forks source link

Spring boot transaction management #34

Open DevShivmohan opened 1 year ago

DevShivmohan commented 1 year ago

Transaction management in Spring boot

YouTub source - Link

ACID properties

What is ACID transaction? ACID is an acronym that stands for atomicity, consistency, isolation, and durability:

Atomicity describes an all or nothing principle. Either all operations performed within the transaction get executed or none of them. That means if you commit the transaction successfully, you can be sure that all operations got performed. It also enables you to abort a transaction and roll back all operations if an error occurs.

The consistency characteristic ensures that your transaction takes a system from one consistent state to another consistent state. That means that either all operations were rolled back and the data was set back to the state you started with or the changed data passed all consistency checks. In a relational database, that means that the modified data needs to pass all constraint checks, like foreign key or unique constraints, defined in your database.

Isolation means that changes that you perform within a transaction are not visible to any other transactions until you commit them successfully

Durability ensures that your committed changes get persisted.