ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjewett <sjew...@clarksna.com>
Subject Re: Identify the record that caused unique constraint violation
Date Wed, 13 May 2009 12:51:43 GMT

dm3 -

Thank you.  I'll try that.  I have a related question:  Is there a way to
invoke the executeBatch() for the inserts and have iBATIS simply skip the
record that gets the unique constraint violation, and keep going?

Thanks again.
-sjewett


dm3 wrote:
> 
> Well, you can try logging `java.sql.*` if you're not already doing it. The
> last statement before error should be what you're looking for.
> 
> On Tue, May 12, 2009 at 11:57 PM, sjewett <sjewett@clarksna.com> wrote:
> 
>>
>> Hi All,
>>
>> We are using iBATIS 2.1.7.  I'm getting a java.sql.BatchUpdateException:
>> ORA-00001: unique constraint when using executeBatch to insert records. 
>> I
>> would like to get some information (field values) about the specific
>> record
>> that caused the unique constraint violation.
>>
>> I read in the iBATIS documentation that with version 2.2.0 there is an
>> executeBatchDetailed method.  The documents says that "If a
>> java.sql.BatchUpdateException occurs, the method will throw
>> BatchException
>> which contains information about the statement that caused the exception
>> .
>> .
>> ."
>>
>> Does anyone know if this means I can identify the record that caused the
>> violation?  Or if there is another way to get this information when using
>> batch inserts?
>>
>> Any help is appreciated.
>>
>> Thank you,
>> sjewett
>> --
>> View this message in context:
>> http://www.nabble.com/Identify-the-record-that-caused-unique-constraint-violation-tp23510359p23510359.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Identify-the-record-that-caused-unique-constraint-violation-tp23510359p23521134.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Mime
View raw message