ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholoz Koka Kiknadze <kikna...@gmail.com>
Subject Re: Identify the record that caused unique constraint violation
Date Wed, 13 May 2009 13:01:46 GMT
It may be database dependent. Here's extract from oracle docs
http://download.oracle.com/docs/cd/B10501_01/java.920/a96654/oraperf.htm


After a batch exception, the update counts array can be retrieved using the
getUpdateCounts() method of the BatchUpdateException object. This returns an
int array of update counts, just as the executeBatch() method does. In the
Oracle implementation of standard update batching, contents of the update
counts array are as follows after a batch exception:

   - For a prepared statement batch, it is not possible to know which
   operation failed. The array has one element for each operation in the batch,
   and each element has a value of -3. According to the JDBC 2.0 specification,
   a value of -3 indicates that an operation did not complete successfully. In
   this case, it was presumably just one operation that actually failed, but
   because the JDBC driver does not know which operation that was, it labels
   all the batched operations as failures.

   You should always perform a ROLLBACK operation in this situation.

Mime
View raw message