It’s 2023 and you still don’t know why your affairs have expired?

What is a transaction?

Insert image description here

Transaction refers to a series of database operations performed as a logical unit. It treats a set of related operations as a whole, and either all of them are executed successfully or all of them are rolled back to ensure the consistency and integrity of the database.

Transactions have the following four properties, often called ACID properties:

  1. Atomicity: All operations in a transaction either execute successfully or fail to roll back, with no intermediate state. If any operation in the transaction fails, all operations will be rolled back and the database state will be restored to the state before the transaction started.
  2. Consistency: The integrity constraints of the database must be maintained before and after the transaction is executed. This means that modifications made during transaction execution must satisfy all preset rules and constraints of the database.
  3. Isolation: Multiple transactions executed concurrently should be isolated from each other and invisible to each other. Modifications made by each transaction during execution are not visible to other transactions until the transaction commits. This can avoid data inconsistency problems caused by concurrent access.
  4. Durability: Once the transaction is submitted successfully

Guess you like

Origin blog.csdn.net/weixin_44427181/article/details/133299547