Re: Efficient Insert statement for one record into multiple - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: Efficient Insert statement for one record into multiple
Date
Msg-id 30DA21B9-0758-4A54-BC35-D955A2D95B83@fastcrypt.com
Whole thread Raw
In response to Re: Efficient Insert statement for one record into multiple  ("Peter Neu" <peter.neu@gmx.net>)
List pgsql-jdbc
If you create the key using nextval you will never get duplicate key
exceptions.

However, you should never close connections in the catch clause.
Always close connections in a finally clause.

Dave
On 19-Dec-06, at 5:18 AM, Peter Neu wrote:

> Hello,
>
> 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?
>
> Cheers,
> Pete
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org so that
> your
>        message can get through to the mailing list cleanly
>


pgsql-jdbc by date:

Previous
From: Markus Schaber
Date:
Subject: Re: Efficient Insert statement for one record into multiple
Next
From: Mikko Tiihonen
Date:
Subject: Binary binding patch v1