MySQL transaction (Transaction)

MySQL Affairs

Defined transaction

Transaction: a minimum unit of work can not be subdivided: In general, a transaction, corresponds to a whole business.

Only matters related to data manipulation language (DML).

Four features of the transaction (ACID)

  • Atoms of (A)

    All operations in one transaction (transaction) is either completed or not completed all, it 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 start of the transaction, as the transaction never performed the same.

  • Consistency (C)

    And after the end of the transaction before the transaction began, the integrity of the database is not corrupted. This means that data written must be fully compliant with all of the default rules, which include data accuracy, and a series of follow-up database can complete the scheduled work spontaneously.

  • Isolation of (I)

    A plurality of concurrent transactions database allows simultaneous read and write capabilities and modify its data, the isolation can be prevented when a plurality of transactions concurrently perform cross executed result in inconsistent data. Transaction isolation divided into different levels, including Uncommitted Read (Read uncommitted), Read Committed (read committed), repeatable read (repeatable read) and serialized (Serializable).

  • Persistent (D)

    After the transaction, to modify the data is permanent, even if the system failure will not be lost.

Guess you like

Origin www.cnblogs.com/you-you/p/11961369.html