spring事务

关于spring事务解释的很好的一片文章:https://blog.csdn.net/trigl/article/details/50968079

1.自己参考网上的代码写的测试:

编程式事物:

xml配置文件:

声明式事物:

 

 

<aop:advisor advice-ref="txAdvice" pointcut-ref="createOperation"/> advice-ref="txAdvice"指定事物传播特性,pointcut-ref="createOperation"指定那些方法参加事物,
虽然这里制定了StudentJDBCTemplate中所有的方法,但是如果在事物传播特性里面没有指定具体的方法,或者制定了,但是遗漏了其中一些方法,那么遗漏的那些方法是不参与事物的。
参考:https://www.cnblogs.com/rushoooooo/archive/2011/08/28/2155960.html
posted @ 2019-05-28 18:00  yuby  阅读(132)  评论(0编辑  收藏  举报