Spring transaction Propagation type

Source: Internet
Author: User

Spring defines seven types of transaction propagation behaviors in the TransactionDefinition interface, which specifies how the transaction method and transaction method are propagated by nested call of the current affairs: transaction propagation action type transaction propagation action type description PROPAGATION_REQUIRED creates a transaction if no transaction exists. If a transaction already exists, add it to the transaction. This is the most common choice. PROPAGATION_SUPPORTS supports the current transaction. If no transaction exists, it is executed in non-transaction mode. PROPAGATION_MANDATORY uses the current transaction. If no transaction exists, an exception is thrown. PROPAGATION_REQUIRES_NEW creates a transaction. If a transaction exists, it is suspended. PROPAGATION_NOT_SUPPORTED performs operations in non-transactional mode. If a transaction exists, the current transaction is suspended. PROPAGATION_NEVER is executed in non-transaction mode. If a transaction exists, an exception is thrown. PROPAGATION_NESTED if a transaction exists, it is executed within the nested transaction. If no transaction exists, the operation is similar to that of PROPAGATION_REQUIRED.

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.