读书人

dao中多个方法调用事务回滚有关问题

发布时间: 2012-10-09 10:21:45 作者: rapoo

dao中多个方法调用事务回滚问题

<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>   <prop key="list*">PROPAGATION_REQUIRED,readOnly</prop>   <prop key="insert*">PROPAGATION_REQUIRED,-Exception</prop>   <prop key="update*">PROPAGATION_REQUIRED,-Exception</prop>




dao只有在抛出RuntimeException才会自动回滚


1.在transactionAttributes中定义-Exception
2.在dao中抛出RuntimeException

读书人网 >编程

热点推荐