错误信息:
严重: 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"。