X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1AC15D8CA3 for ; Tue, 13 Sep 2005 04:07:03 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 69579-09 for ; Tue, 13 Sep 2005 07:06:59 +0000 (GMT) Received: from mail.jenomics.net (jenomics.net [82.165.26.106]) by svr1.postgresql.org (Postfix) with ESMTP id 9A968D8C51 for ; Tue, 13 Sep 2005 04:06:58 -0300 (ADT) Received: (qmail 11725 invoked by uid 1010); 13 Sep 2005 09:06:59 +0200 Received: from an@jenomics.net by s15168749 by uid 1008 with qmail-scanner-1.22-st-qms (spamassassin: 2.20. Clear:RC:0(84.154.72.52):SA:0(?/?):. Processed in 0.256037 secs); 13 Sep 2005 07:06:59 -0000 X-Antivirus-jenomics-Mail-From: an@jenomics.net via s15168749 X-Antivirus-jenomics: 1.22-st-qms (Clear:RC:0(84.154.72.52):SA:0(?/?):. Processed in 0.256037 secs Process 11719) Received: from p549a4834.dip.t-dialin.net (HELO ?10.136.136.208?) (aneuschitzer@jenomics.net@84.154.72.52) by mail.jenomics.net with RC4-MD5 encrypted SMTP; 13 Sep 2005 09:06:59 +0200 Message-ID: <43267ACC.1020307@jenomics.net> Date: Tue, 13 Sep 2005 09:07:56 +0200 From: Angelo Neuschitzer Organization: Jenomics GmbH User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Oliver Jowett Cc: pgsql-jdbc@postgresql.org Subject: Re: Strange behavoir of batches References: <20050907165251.35F37F1098@svr2.postgresql.org> <43205847.8050405@archonet.com> <43255496.5020703@jenomics.net> <43255EDB.6000306@jenomics.net> <4325FA5D.2060402@opencloud.com> In-Reply-To: <4325FA5D.2060402@opencloud.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/41 X-Sequence-Number: 13826 Yes, I know, I found the problem for me already. If one does call addBatch() every time it works fine. But thats not the point. If I don't do it (there should be 1 line missing each block) but fiddle around with the second block { // original insert 82 rows (in table B) 2 (in table C) 9 (in table D) { { // changed 2 (in table C) 9 (in table D) 82 (in table B) { it works well... Also It should not matter at all what is in tables B,C and D if I enter a reference from A to E... but it seems that it does. If got some minutes free I'll go and get the old code again to reproduce some things and write a report. Zo Phar Angelo Neuschitzer Oliver Jowett wrote: >Angelo Neuschitzer wrote: > > > >>>PreparedStatemet pStmt = con.prepareStatement("INSERT INTO table_a >>>VALUES (...)"); >>>for(0 to 93) >>>{ >>> [fill values into pStmt] >>> if(not last row) >>> { >>> pStmt.addBatch(); >>> } >>>} >>>pStmt.executeBatch(); >>>pStmt.clearBatch(); >>> >>> > >AFAIK, this "not last row" logic seems wrong. Calling executeBatch() >only executes those queries that have been added to the batch via >addBatch(), so the loop will lose the last INSERT. > >-O > > > > -- Angelo Neuschitzer Development Java. Mit Sicherheit. Jenomics GmbH, Thalkirchnerstraße 55, 80337 München, Deutschland www.jenomics.de an@jenomics.de Tel: +49 (0) 89 767 59 003; Fax: +49 (0) 89 767 59 005 ------------------------------------------------------ Diese Nachricht enthält vertrauliche Informationen und ist ausschließlich für den Adressaten bestimmt. Der Gebrauch durch Dritte ist verboten. Jenomics ist nicht verantwortlich für die ordnungsgemäße, vollständige oder verzögerungsfreie Übertragung dieser Nachricht. This message may contain confidential information and is intended solely for the use by the addresse. Use of this communication by others is prohibited. Jenomics are neither liable for the proper and complete transmission of the information in this message nor for any delay in its receipt.