0
我已經在數據庫中使用hibernate創建了一個表,並且其中一個屬性(username)是主鍵。所以當我嘗試在用戶名中插入重複值時,出現以下異常。現在,我必須處理這個異常,以提示用戶爲「用戶名已存在」。休眠主鍵異常
22462 [HTTP-8080-2] WARN org.hibernate.util.JDBCExceptionReporter - SQL錯誤:0,SQLSTATE:空 22462 [HTTP-8080-2] ERROR org.hibernate.util.JDBCExceptionReporter - 失敗批次 22462 [http-8080-2] ERROR org.hibernate.event.def.AbstractFlushingEventListener - 無法使數據庫狀態與會話同步
可能的重複-http://stackoverflow.com/questions/3820452/hibernate-could-not-synchronize-database-state-with-session – Rocky 2012-02-25 05:08:27