亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

怎么修改hibernate 的Flush模式

怎么修改hibernate 的Flush模式

暴躁的代碼 2017-05-05 10:15:13
在學習ssh整合的時候,報錯Write operations are not allowed in read-only mode (FlushMode.MANUAL) :Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.protected void checkWriteOperationAllowed(Session session) throws InvalidDataAccessApiUsageException { if (isCheckWriteOperations() && session.getFlushMode().lessThan(FlushMode.COMMIT)) { throw new InvalidDataAccessApiUsageException( "Write operations are not allowed in read-only mode (FlushMode.MANUAL): "+ "Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition."); } }這個FlushMode為什么會默認是MANUAL,怎么修改呢?
查看完整描述

1 回答

已采納
?
younghu

TA貢獻25條經驗 獲得超6個贊

這個錯誤一般都是沒有配置事務引起的,你在spring中配置好事務,問題應該就解決了!

查看完整回答
反對 回復 2017-05-08
  • 1 回答
  • 0 關注
  • 2319 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號