Re: bug in new StatementHandler

From: Aaron Mulder <ammulder(at)alumni(dot)princeton(dot)edu>
To: PostgreSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: bug in new StatementHandler
Date: 2002-12-12 19:06:05
Message-ID: Pine.LNX.4.44.0212121401110.11322-100000@www.princetongames.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

The patch to fix the bug looks good.

The patch for the test could be improved. Instead of letting the
InvocationTargetException fall through, can you revise the test patch to
catch Exception after it catches SQLException with a failure message like
"wrong type of exception thrown; expecting SQLException not "+
e.getClass().getName() or something along those lines?

Thanks,
Aaron

On Thu, 12 Dec 2002, Mike Beachy wrote:
> There's a problem in how exceptions are handled (or rather, not handled)
> in the new StatementHandler. If an SQLException is thrown in one of the
> Statement methods, java.lang.reflect.Method catches it and throws it as
> an InvocationTargetException. The handler needs to catch this and
> extract the underlying exception.
>
> A test for this problem and a patch are attached.
>
> The same problem seems to exist for the ConnectionHandler, so I
> implemented the code there as well. Aaron, if you could double check
> what I've done that'd be cool.
>
> Thanks.
>
> Mike
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mike Beachy 2002-12-12 19:57:59 Re: bug in new StatementHandler
Previous Message Mike Beachy 2002-12-12 18:47:00 bug in new StatementHandler