第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

就是想請(qǐng)問(wèn)一下spring的這個(gè)方法是不是一個(gè)事務(wù)?

就是想請(qǐng)問(wèn)一下spring的這個(gè)方法是不是一個(gè)事務(wù)?

牛魔王的故事 2022-05-06 17:07:27
getHibernateTemplate().saveOrUpdateAll(List list);這個(gè)方法可以保存或修改多個(gè)對(duì)象,我想問(wèn)如果其中一個(gè)出錯(cuò)了,其它的會(huì)不會(huì)回滾?已經(jīng)用了spring來(lái)管理事務(wù)了<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貢獻(xiàn)1809條經(jīng)驗(yàn) 獲得超8個(gè)贊

不清楚,如果是bo.savOrUpdateAll(list)應(yīng)該可以的,如果你的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>

查看完整回答
反對(duì) 回復(fù) 2022-05-10
?
小唯快跑啊

TA貢獻(xiàn)1863條經(jīng)驗(yàn) 獲得超2個(gè)贊

你還是用junit測(cè)試一下比較保險(xiǎn)。或者可以嘗試用spring來(lái)管理事務(wù)。

查看完整回答
反對(duì) 回復(fù) 2022-05-10
  • 2 回答
  • 0 關(guān)注
  • 192 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)