In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what does transaction refer to in php". In daily operation, I believe that many people have doubts about what transaction refers to in php. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubt of "what does transaction refer to in php?" Next, please follow the editor to study!
In PHP, a transaction is a group of atomic SQL queries, or an independent unit of work; a transaction is a logical unit of work in which PHP operates the database, and all or no modifications to the database are performed; transactions have four characteristics: atomicity, consistency, isolation and persistence.
This article operating environment: Windows10 system, PHP7.1 version, Dell G3 computer.
What does transaction mean in php
A transaction is a set of atomic SQL queries, or a separate unit of work.
A transaction is a series of rigorous operations in an application, and all operations must be completed successfully, otherwise all changes made in each operation will be undone. That is, transactions are atomic, and a series of operations in a transaction are either successful or none at all.
There are two ways to end a transaction, and when all the steps in the transaction are executed successfully, the transaction commits. If one of the steps fails, a rollback operation occurs, undoing all actions from the previous to the beginning of the transaction.
Four characteristics of PHP transaction
Atomicity (Atomicity):
Transaction is the logical working unit of the database, and it either performs all or none of the changes to the database.
Consistency (Consistemcy):
Before and after the transaction, the state of the database satisfies all integrity constraints.
Isolation (Isolation):
Transactions executed concurrently are isolated, one does not affect the other. If there are two transactions that run at the same time and perform the same function, the isolation of the transaction ensures that each transaction is thought to be the only transaction in the system that is using the system. This attribute is sometimes called serialization, and to prevent confusion between transaction operations, requests must be serialized or serialized so that only one request is used for the same data at a time.
Different isolation effects can be achieved by setting the isolation level of the database.
Persistence (Durability):
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.
At this point, the study of "what is the meaning of affairs in php" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.