Detailed discussion on transaction management of spring framework

1、 Programming transaction

2、 Declarative transaction

1. XML based transactions

1.1 spring configuration file

1.2 business

It is the same as the class used in the following annotation method, but the annotation is removed. I put all the service layers under one package to facilitate the writing of AOP pointcut expressions

2. Annotation based transactions

2.1. Sprint configuration file

2.2. Business class (spring starts transactions on the service layer)

2.3 transaction attributes (transaction isolation level, transaction propagation behavior, transaction exception control, transaction forced rollback time control, and whether the transaction is read-only)

Generally, you do not need to change the transaction attributes manually. Just use the default

3. Test class

The above detailed discussion on the transaction management of the spring framework is all the content shared by Xiaobian. I hope it can give you a reference and support more programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>