What is a transaction?

Source: Internet
Author: User

Atomicity (A), consistency (C), independence (I), and persistence (D) of transactions)

1. atomicity of a transaction refers to whether a transaction is executed in full or not.

2. transaction consistency means that the transaction operation does not change the data consistency in the database. for example, if the integrity constraint is a + B = 10 and a transaction changes a, then B should change accordingly. the result of transaction execution must be that the database changes from one consistent state to another consistent state.

3. The independence of a transaction means that two or more transactions do not have the status of staggered execution, because this may cause data inconsistency. The execution of a transaction cannot be disturbed by other transactions.

4. Transaction Persistence means that after the transaction runs successfully, system updates are permanent and will not be rolled back for no reason.

Transactions generally start with begin transaction and end with commit or rollback. Commit indicates commit, that is, all operations to commit a transaction. Specifically, all the updates to the database in the transaction are written back to the physical database on the disk, and the transaction ends normally. Rollback indicates rollback, that is, a fault occurs during the transaction operation, and the transaction cannot continue. The system revokes all the completed operations on the database in the transaction, roll back to the starting state of the transaction.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.