Spring five transaction isolation levels and seven transaction propagation behavior

Source: Internet
Author: User

The five transaction interval levels are: Lsolation property values

1,default

Default transaction ISOLATION LEVEL

2,read_uncommitted

READ UNCOMMITTED, one transaction can operate another uncommitted transaction, cannot avoid dirty read, non-repeatable read, Phantom read, isolation level is lowest, concurrency performance is highest

3,read_committed

Read Committed, one transaction can not operate another uncommitted transaction, can prevent dirty read, cannot avoid non-repeatable read, Phantom read.

4,repeatable_read

Be able to avoid dirty reading, non-repeatable reading, cannot avoid phantom reading

5,serializable

Highest isolation level, lowest resource consumption, highest cost, ability to prevent dirty reads, non-repeatable reads, Phantom reads.


Propagation behavior of seven transactions

1,propagation_required

If a transaction exists, the current transaction is supported, and if it does not exist, a new transaction is created

2,propagation_supports

If a transaction exists, the current transaction is supported and the non-transactional method runs if it does not exist

3,propagation_mendatory

If a transaction exists, the current transaction is supported, and if present, an exception is thrown

4,propagation_requires_new

Always open a new transaction, suspend the transaction if the transaction exists

5,propagation_not_supported

The total non-transactional method runs and suspends all transactions

6,propagation_never

The total non-transactional method runs, and throws an exception if the transaction exists

7,propagation_nested

A transaction exists, it is run in a nested 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.