agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feedSubject: [Pljava-dev] Problem with primary key
Date: Thu, 18 May 2006 09:35:33 +0200
Message-ID: <446C23C5.207@tada.se> (raw)
In-Reply-To: <446C1EE3.2030605@insa-toulouse.fr>
References: <4469E7C0.4040502@insa-toulouse.fr>
<4469F3E6.6070802@tada.se>
<446C1EE3.2030605@insa-toulouse.fr>
Eric BOYER wrote:
> Thomas Hallgren a ?crit :
>
>> Eric,
>> You say that you re-throw the exception in your catch. Yet, in your
>> example you don't do that. Also, to do an e.printStackTrace() might
>> be a bad idea sometimes. If the postmaster runs as a service, there
>> will be no System.out assigned.
>>
>>
> It was a simple test. In reality, we use log4j !
Really? Why is that? You are aware that PL/Java is adapting the standard
java.util.logging stuff on top of the PostgreSQL logger? More info here:
http://wiki.tada.se/display/pljava/Logging
> OK but we wan't catch exception for different reasons ...
You must use savepoints if you plan to catch SQLExceptions without
throwing them again (see:
http://wiki.tada.se/display/pljava/Exception+handling). If you don't it
really shouldn't matter if you catch a ServerException (the subclass of
SQLException that you must have encountered). That exception will always
be re-thrown and cause a rollback once your method returns. And that's
regardless of if you catch it or not.
The fact that the backend reached an unstable state actually indicates a
bug in PL/Java. My guess is that the endless recursion that you caused
somehow messed up the internal error handling. I'll look into that.
Regards,
Thomas Hallgren
view thread (6+ messages)
Message-ID: <446C23C5.207@tada.se>
Permalink: ../446C23C5.207@tada.se/
Also on: postgresql.org/message-id/446C23C5.207@tada.se
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pljava-dev@postgresql.org
Subject: Re: [Pljava-dev] Problem with primary key
In-Reply-To: <446C23C5.207@tada.se>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox