Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 1A9149FB703 for ; Wed, 11 Jul 2007 10:05:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 51815-07 for ; Wed, 11 Jul 2007 10:04:53 -0300 (ADT) X-Greylist: delayed 00:06:39.487594 by SQLgrey-1.7.5 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id E50FB9FA66C for ; Wed, 11 Jul 2007 10:04:53 -0300 (ADT) Received: (qmail 4222 invoked by uid 0); 11 Jul 2007 12:58:11 -0000 Received: from 85.115.15.50 by www077.gmx.net with HTTP; Wed, 11 Jul 2007 14:58:11 +0200 (CEST) Content-Type: text/plain; charset="us-ascii" Date: Wed, 11 Jul 2007 14:58:11 +0200 From: "Marcel Steinbach" Message-ID: <20070711125811.313870@gmx.net> MIME-Version: 1.0 Subject: incomplete batch-inserts To: pgsql-jdbc@postgresql.org X-Authenticated: #1089297 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX1+vD/gnXquvzy3qWNl4DNNEb8RbhkVIBsN7burwBG XHcdQWHks1IEPaAtfCNhgBCx8qIwr9QMXPHw== Content-Transfer-Encoding: 7bit X-GMX-UID: 2+Gtc6A3eWUoUXn+Y3Vzrs4xU3U4N489 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200707/44 X-Sequence-Number: 17218 Hello, i'm having trouble with batches. When I run into an BatchUpdateException, the table is filled up to a multiple of 256 records (guess, the batch seems to be executed in 256-steps), and, for example, if the Exception was thrown at the 300. statements, the tablesize is 256, and 44 are missing - but: The getUpdateCount() says, that all statements until the Exception (299) affacted "1" row. My code looks something like this: --------------------------------------------------------- PreparedStatement stmt = con.prepareStatement(sql); con.setAutoCommit(true); for (int i = 0; i < objectBuffer.length; i++) { for (int j =0; j < objectBuffer[i].length; j++) { stmt.setObject(j+1, objectBuffer[i][j]); } stmt.addBatch(); } int updateCount[] = { }; try { updateCount = stmt.executeBatch(); } catch (...) { ... --------------------------------------------------------- Some ideas whats wrong? I'm using postgresql-8.1-405.jdbc3. Best Regards Marcel Steinbach