tx:advice 强调事务

<tx:advice id="multiMybatisAdvice" transaction-manager="multiMybatisTransactionManager"> 
<tx:attributes> 
<tx:method name="save*" propagation="REQUIRED" /> 
<tx:method name="insert*" propagation="REQUIRED" /> 
<tx:method name="add*" propagation="REQUIRED" /> 
<tx:method name="update*" propagation="REQUIRED" /> 
<tx:method name="delete*" propagation="REQUIRED" /> 
<tx:method name="remove*" propagation="REQUIRED" /> 
<tx:method name="accept*" propagation="REQUIRED" /> 
<tx:method name="reject*" propagation="REQUIRED" /> 
<tx:method name="execute*" propagation="REQUIRED" /> 
<tx:method name="del*" propagation="REQUIRED" /> 
<tx:method name="recover*" propagation="REQUIRED" /> 
<tx:method name="sync*" propagation="REQUIRED" /> 
<tx:method name="*" read-only="true" /> 
</tx:attributes> 
</tx:advice>

这段代码的意思就是表示,所有的例如以save开头的方法或者以insert开头的方法都会执行事务。

猜你喜欢

转载自blog.csdn.net/u012045045/article/details/84841183