自由飛翔

          我在仰望,java之上

          統(tǒng)計

          留言簿(2)

          我關(guān)注的blog

          閱讀排行榜

          評論排行榜

          異常積累:org.hibernate.StaleStateException

          ERROR - Exception executing batch: 
          org.hibernate.StaleStateException: Batch update returned unexpected row count fr
          om update [0]; actual row count: 0; expected: 1

          ERROR - Could not synchronize database state with session
          org.hibernate.StaleStateException: Batch update returned unexpected row count fr
          om update [0]; actual row count: 0; expected: 1


          不注意的話,還真的有點(diǎn)無所適從,Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
          這個異常是由于主鍵設(shè)置為自增長,而在我們插入記錄的時候設(shè)置了ID的值導(dǎo)致的。看下我的Hibernate映射文件中ID的定義:

          參考文章:http://hi.baidu.com/shirdrn/blog/item/adec1e82d067ddb86c81191c.html


          Gavin

          posted on 2012-04-18 15:33 GavinMiao 閱讀(10590) 評論(0)  編輯  收藏 所屬分類: 異常積累

          主站蜘蛛池模板: 达州市| 搜索| 新建县| 治多县| 江津市| 达拉特旗| 长岛县| 关岭| 石狮市| 牟定县| 泾源县| 成武县| 长岛县| 三原县| 秀山| 寻乌县| 庆元县| 北票市| 东山县| 杨浦区| 临城县| 屯留县| 子洲县| 虞城县| 新安县| 抚宁县| 玛曲县| 南召县| 裕民县| 松滋市| 辽中县| 大足县| 台南市| 团风县| 曲松县| 乌拉特中旗| 张北县| 彭泽县| 济阳县| 聂荣县| 南郑县|