首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

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

2012-10-09 
dao中多个方法调用事务回滚问题prop keyfind*PROPAGATION_REQUIRED,readOnly/propprop keylist*

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

热点排行