Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 27FB59FB6F9 for ; Fri, 3 Aug 2007 21:59:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 45933-04 for ; Fri, 3 Aug 2007 21:58:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id CAF189FB366 for ; Fri, 3 Aug 2007 21:59:03 -0300 (ADT) Received: from 222-154-135-183.jetstream.xtra.co.nz ([222.154.135.183] helo=[10.1.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1IH7yt-0000zS-9t; Sat, 04 Aug 2007 12:58:59 +1200 Message-ID: <46B3CF4F.4020705@opencloud.com> Date: Sat, 04 Aug 2007 12:58:55 +1200 From: Oliver Jowett User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: albertlaszlorobert@gmail.com CC: pgsql-jdbc@postgresql.org Subject: Re: PSQLException: Too many update results were returned. References: <373352.78463.qm@web32701.mail.mud.yahoo.com> <46B3CBA0.3040203@opencloud.com> <46B3CDEB.2060608@gmail.com> In-Reply-To: <46B3CDEB.2060608@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/24 X-Sequence-Number: 17337 Albert László-Róbert wrote: > yes, the statements are semicolon-separated. than you have some idea how > to make it to work? Try adding only one statement per addBatch() i.e. instead of stmt.addBatch("insert a; insert b; insert c"); do: stmt.addBatch("insert a"); stmt.addBatch("insert b"); stmt.addBatch("insert c"); > note: if i use a simple executeUpdate for multiple inserts that are > semicolon-separated, than they work. Yes, executeUpdate is a different code path that does understand semicolon-separated paths. The batch code expects exactly one command status per addBatch(). It's not clear from the JDBC API what you're meant to do with an addBatch() call that returns more than one thing, since executeBatch() is meant to return one array element (representing the update status) per addBatch() call AFAIK. -O