ssi批量增加java.sql.SQLException: Connection is closed.
2012-04-10 09:17
375 查看
ssi集成,在批量增加数据的时候一定要自己控制事务的开启,否则你批量增加就没有效果,但就是在批量增加结束,立即执行另外一条sql语句时就会报错!后来度娘无果,谷歌也不给力,发现自己在结束操作的时候没有结束事务导致这个异常!
int result=0; sqlMapClient.startTransaction(); sqlMapClient.startBatch(); for(int i=0;i<reportDayItemsList.size();i++){ ReportDayItemsVO reportDayItems=reportDayItemsList.get(i); sqlMapClient.insert("day.insertDayReportItem",reportDayItems); } result=sqlMapClient.executeBatch(); sqlMapClient.commitTransaction(); sqlMapClient.endTransaction(); return result;
相关文章推荐
- Play Framework 报错 java.sql.SQLException: Connection is closed!
- Cause: java.sql.SQLException: JZ0C0: Connection is already closed
- java.sql.SQLException: Connection is closed
- Cause: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not
- java.sql.SQLException: ResultSet is closed解决方法
- java.sql.SQLException: connection holder is null
- 异常—Cause: java.sql.SQLException: Data source is closed
- java.sql.SQLException: No operations allowed after connection closed.Connection was implicitly clos
- java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed
- java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed
- Cause: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not
- java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed
- Caused by: java.sql.SQLException: connection holder is null
- java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed
- java.sql.SQLException: nontx connection pool is full?
- java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed
- Java错误提示-------java.sql.SQLException:ResultSet is closed
- java.sql.SQLException: ResultSet is closed解决方法
- Cause: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not
- java.sql.SQLException: statement is closed语句被关闭 druid连接池报错