Spring declarative transaction needs to configure transaction attribute tx:method

The saveAdmin method called by the service layer saves the t_admin table records. Because tx:method is configured and it meets the pointcut expression, it is in the transaction.
Insert picture description here

Insert picture description here
Remove the tx:method of save*, test the service method, the log becomes as follows, not in the transaction, this should be noted.
Insert picture description here

Guess you like

Origin blog.csdn.net/huangbaokang/article/details/113624400