批次處理錯誤解決辦法

錯誤信息:

嚴重: Servlet.service() for servlet action threw exception
java.sql.BatchUpdateException: 批次處理 0 update public.basestation set a_id='0', bs_longitude='123.0', bs_latitude='12.0', bs_km='12.0', bs_type='8002', bs_name='測試基站3', bs_style='1', bs_vip='1', bs_antenna='12/123', bs_descrip='適當方式大幅' where bs_id='36087' 被中止,呼叫 getNextException 以取得原因。
 at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2569)
 at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1796)
 at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407)
 at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2708)
 at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
 at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)

解決辦法:

將該映射的實體hbm.xml文件中的<<many-to-one>中將update="ture" 改爲false,或者加上update="false"。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章