Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id D05439F9F46 for ; Tue, 19 Dec 2006 07:04:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 09290-07 for ; Tue, 19 Dec 2006 07:03:58 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 552A09F9386 for ; Tue, 19 Dec 2006 07:04:02 -0400 (AST) Received: from kingfisher.intern.logix-tt.com (84-72-188-217.dclient.hispeed.ch [84.72.188.217]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 813F764BFA for ; Tue, 19 Dec 2006 12:06:52 +0100 (CET) Received: from kingfisher.sec.intern.logix-tt.com (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id DD2B4895C0 for ; Tue, 19 Dec 2006 12:03:52 +0100 (CET) Date: Tue, 19 Dec 2006 12:03:52 +0100 From: Markus Schaber To: pgsql-jdbc@postgresql.org Subject: Re: Efficient Insert statement for one record into multiple Message-ID: <20061219120352.7ebf0ffc@kingfisher.sec.intern.logix-tt.com> In-Reply-To: <00f201c72357$0ba220d0$bcc8a8c0@PCMELZER> References: <4586C04D.5070008@gmx.net> <00f201c72357$0ba220d0$bcc8a8c0@PCMELZER> Organization: www.logix-tt.com X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/93 X-Sequence-Number: 16325 Hi, Peter, "Peter Neu" wrote: > the insertion within the same connection objects works just fine. ;o) > One thing which still keeps me thinking is how should I handle duplicate > key exceptions when it happens in the first insert? Should I just close > the connection object in the catch clause when this happens in the first > statement so the second statement hits an AlreadyClosedConnectionException? Why execute the second statement at all? Maybe you should rework the control flow of your application. Regards, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org