getHibernateTemplate().saveOrUpdateAll(List list);这个方法可以保存或修改多个对象,我想问如果其中一个出错了,其它的会不会回滚?已经用了spring来管理事务了<bean id="ServicesProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"lazy-init="true" abstract="true"><property name="transactionManager"><ref local="txTransactionManager"/></property><property name="transactionAttributes"><props><prop key="save*">PROPAGATION_REQUIRED</prop><prop key="update*">PROPAGATION_REQUIRED</prop><prop key="delete*">PROPAGATION_REQUIRED</prop><prop key="do*">PROPAGATION_REQUIRED</prop><prop key="recv*">PROPAGATION_REQUIRED</prop><prop key="find*">PROPAGATION_REQUIRED,readOnly</prop><prop key="get*">PROPAGATION_REQUIRED,readOnly</prop><prop key="send*">PROPAGATION_REQUIRED</prop></props></property></bean>
2 回答
海绵宝宝撒
TA贡献1809条经验 获得超8个赞
不清楚,如果是bo.savOrUpdateAll(list)应该可以的,如果你的bo也这么配置了
<bean id="ypglBO"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<ref local="ypglBOTarget" />
</property>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED,-SQLException</prop>
</props>
</property>
</bean>
- 2 回答
- 0 关注
- 256 浏览
添加回答
举报
0/150
提交
取消
