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 關注
- 199 瀏覽
添加回答
舉報
0/150
提交
取消