Home >Database >Mysql Tutorial >Four characteristics and meanings of database transactions [detailed explanation]

Four characteristics and meanings of database transactions [detailed explanation]

藏色散人
藏色散人Original
2018-09-05 15:15:563348browse

This article introduces you to the four characteristics and meaning of database transactions. We can refer to the MySQL video tutorial and MySQL manual on the PHP Chinese website!

Four characteristics and meanings of database transactions

Four basic elements for the correct execution of database transaction transactions.

ACID

Atomicity

Atomicity: All operations in the entire transaction are either completed or not completed, and it is impossible to stagnate somewhere in the middle link. If an error occurs during the execution of the transaction, it will be rolled back to the state before the transaction started, as if the transaction had never been executed.

Consistency (Correspondence)

Consistency: Before the transaction starts and after the transaction ends, the integrity constraints of the database are not violated.

Isolation

Isolation: Execute transactions in an isolated state so that they appear to be the only operations performed by the system at a given time. If there are two transactions, running at the same time, execute With the same function, transaction isolation will ensure that each transaction in the system thinks that only that transaction is using the system. This property is sometimes called serialization. To prevent confusion between transaction operations, requests must be serialized or serialized. requests so that there is only one request for the same data at the same time.

Durability

Persistence: After the transaction is completed, the changes made by the transaction to the database are persisted in the database and will not be rolled back.

The above is the detailed content of Four characteristics and meanings of database transactions [detailed explanation]. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn