Propagation characteristics of Spring transactions

Source: Internet
Author: User

1. In declarative things, the method of one class ServiceA test1 () calls another class ServiceB method Test2 () if ServiceB test2 () transaction configuration is required in the XML file and added on this method

@Transactional (propagation = propagation.not_supported)

Then the Serviceb.test2 () is dominated by XML, and not_supported does not work. If the method does not configure required on the XML, it will work
If you call another method in the same class Test2 add propagation.not_supported, the propagation_not_supported of Test2 () fails
2. If a method in a class test1 () calls another method of this class Test2 (), is required, if the test2 throws an exception, if the test1 does not catch, it will be rolled back, or the Test1 method catch exception, two methods will commit
3. If a method in a class test1 () calls the method of another class Test2 (), is required, if the test2 throws an exception, if the test1 does not catch, it will be rolled back, or the Test1 method catch exception, then still rollback


Ext.: http://8917152.blog.51cto.com/8907152/1544254

Propagation characteristics of Spring transactions

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.