Home > Web Front-end > PS Tutorial > body text

What is the statement to implement transaction submission?

hzc
Release: 2020-07-03 17:34:59
Original
4837 people have browsed it

In the SQL language, the statement to implement transaction submission is COMMIT, and REVOKE is to revoke the access rights of a certain user or a certain group or all users. When the transaction is completed, the COMMIT statement must be used to submit the transaction, otherwise , the transaction operation will fail.

What is the statement to implement transaction submission?

In the SQL language, the language to implement transaction submission is COMMIT; REVOKE: revoke the access rights of a user or a group or all users.

MySQL transactions are mainly used to process data with large operations and high complexity. For example, in the personnel management system, if you delete a person, you need to delete not only the basic information of the person, but also the information related to the person, such as mailbox, articles, etc. In this way, these database operation statements constitute a transaction !

In MySQL, only databases or tables using the Innodb database engine support transactions. Transaction processing can be used to maintain the integrity of the database and ensure that batches of SQL statements are either all executed or not executed at all. Transactions are used to manage insert, update, and delete statements

Generally speaking, transactions must meet four conditions (ACID): Atomicity (or indivisibility), Consistency, Isolation (also known as independence) and durability (Durability).

  • Atomicity: All operations in a transaction will either be completed or not completed, and will not end in any intermediate 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: The integrity of the database is not destroyed before the transaction starts and after the transaction ends. This means that the data written must fully comply with all preset rules, including the accuracy and concatenation of the data, and that the subsequent database can spontaneously complete the predetermined work.

  • Isolation: The database allows multiple concurrent transactions to read, write and modify its data at the same time. Isolation can prevent data corruption due to cross execution when multiple transactions are executed concurrently. Inconsistent. Transaction isolation is divided into different levels, including read uncommitted, read committed, repeatable read and serializable.

  • Persistence: After the transaction is completed, the modification to the data is permanent and will not be lost even if the system fails.

The above is the detailed content of What is the statement to implement transaction submission?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!