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
>