Spring Learning Note (v): Database transactions

Source: Internet
Author: User

ACID: Refers to the abbreviation for four basic elements that database transactions perform correctly. Contains: atomicity (atomicity), consistency (consistency), isolation (isolation), persistence (durability).
One, database transactions have four features:
1, atomicity: That is, from a debit to B, there is a place error, the revocation of the operation
2, consistency: That is, from a debit to B,a and B total unchanged
3, Isolation: In concurrent data operations, different transactions have different data space, do not interfere with each other
4, Persistence: That is, after the transaction commits, if the database crashes immediately, when the database restarts, the submitted data will be automatically recovered
Two
Iii. 3 main interfaces of the high-level abstraction of a transaction management:

Transaction manager:

Transaction ISOLATION Level: dirty read: One thing reads another thing uncommitted update data is not repeatable READ: One thing reads the updated data submitted by another thing magic read: One thing reads the data inserted by another thing MySQL default thing isolation level: Repatable_read (phantom reads may occur Oracle Default: Read_committed (may appear non-repeatable read and Phantom Read)

Propagation behavior of transactions: Solving the problem of mutual invocation between business layer methods-the problem of how transactions are handled when the Web layer invokes multiple service methods (7 types of 3 classes)
The following diagram is a simple schematic diagram:

The following figure is a specific transaction propagation interface class:

Iv. Spring transaction Management in two ways:

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.