Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 52567 invoked from network); 13 May 2009 13:02:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 May 2009 13:02:20 -0000 Received: (qmail 28277 invoked by uid 500); 13 May 2009 13:02:20 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 28259 invoked by uid 500); 13 May 2009 13:02:20 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 28251 invoked by uid 99); 13 May 2009 13:02:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 May 2009 13:02:20 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kiknadze@gmail.com designates 209.85.219.171 as permitted sender) Received: from [209.85.219.171] (HELO mail-ew0-f171.google.com) (209.85.219.171) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 May 2009 13:02:07 +0000 Received: by ewy19 with SMTP id 19so745956ewy.0 for ; Wed, 13 May 2009 06:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=og3aBHVAEr5SV1Mu5XF+ozSD6MWQRNG4TOJiI1OG/zw=; b=QuOhYBEBMvxycpFPVVUUN94jkQYwJ7wSp0ykVC1/z5R1luckPjaG8pd1scennz7aB0 OONuCI4eXAUJdxbIpciUfGlWLwyaCnUPgtvderQEvoPMl7E0HhYJPP6VYYCAZ1IkS+hi RNsc8OvpdDj8rEpIn031RumaqI/0gyqNq84Bw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qhsQmy+RoBwoYFpKUFrX9iNS0h/zOxff05Bf0DFWyTAXIMsb++ZfiYOr0DIslTbYz8 JH5dN3coEfurbXwHO0HGodJMs46G8nGp5yl9R/RWjDvqu71dvsXDRe9ixzOHk+FnDxh1 fDpbyflxDkma0i0H3FWBQqc1GKTMb6BBrXyT8= MIME-Version: 1.0 Received: by 10.216.45.71 with SMTP id o49mr421365web.57.1242219706614; Wed, 13 May 2009 06:01:46 -0700 (PDT) In-Reply-To: <23521134.post@talk.nabble.com> References: <23510359.post@talk.nabble.com> <23521134.post@talk.nabble.com> Date: Wed, 13 May 2009 17:01:46 +0400 Message-ID: <536e8800905130601u7c946b2bq44f9f3fce45ebc2a@mail.gmail.com> Subject: Re: Identify the record that caused unique constraint violation From: Nicholoz Koka Kiknadze To: user-java@ibatis.apache.org Content-Type: multipart/alternative; boundary=0016367d69d858837c0469cad001 X-Virus-Checked: Checked by ClamAV on apache.org --0016367d69d858837c0469cad001 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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. --0016367d69d858837c0469cad001 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 ca= n 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:

  • F= or 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.

    <= /p>

    You should always perform a ROLLBACK operatio= n in this situation.


--0016367d69d858837c0469cad001--