BatchUpdateException: the batch will not terminate

前端 未结 4 964
不知归路
不知归路 2020-12-16 20:36

I have an application which processes a very large file and sends data to an oracle database (using Java 6, oracle 9).

In a loop, I use a PreparedStatement ps

4条回答
  •  爱一瞬间的悲伤
    2020-12-16 21:08

    Oracle itself can, see here: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/oci04sql.htm#sthref616

    However, it doesn't seem that this functionality is exposed to JDBC, not even in the oracle specific classes.

    Because of the rather useless JDBC error handling ("the driver may or may not continue"), I'm always setting a savepoint before the batch, and performing an rollback to that point on error. That's the only JDBC compliant way to establish a known state after an Oracle Batch Error--as far as I know.

提交回复
热议问题