Simple to use MySql affairs

4 properties

  • Atomicity: All operations in a transaction, either completed or not completed all, does not end in the middle of a link. Transaction error occurs during execution, it will be rolled back (rollback) to the state before the transaction began
  • Consistency: before and after the transaction end of the transaction, the integrity of the database is not corrupted. For example, transfers between A and B, regardless of how many times turn, how much turn, the total amount of two people will not change
  • Isolation: between each transaction, there is no correlation, performed separately
  • Durability: After a transaction, changes to the data is permanent

use

  • Begin transaction
    • begin
  • End Transaction
    • Commit the transaction: commit
    • Roll back the transaction: rollbck




Guess you like

Origin www.cnblogs.com/jiyu-hlzy/p/11964390.html