Re: commit and rollback don't throw exceptions when they should

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Kris Jurka" <books(at)ejurka(dot)com>
Cc: "taktos" <taktos(at)gmail(dot)com>, "Oliver Jowett" <oliver(at)opencloud(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: commit and rollback don't throw exceptions when they should
Date: 2009-11-18 19:31:32
Message-ID: 4B03F734020000250002C9F6@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Kris Jurka <books(at)ejurka(dot)com> wrote:

> I've commited a modified version of this patch to HEAD only,
> because changing this behavior could break peoples applications.
>
> I extended the check for the connection already being closed to the
> other connection methods. There's no reason commit/rollback are
> special here.

That all makes sense. I think you have a copy/paste error in the
exception message, though: "This statement has been closed." It is
the connection which has been closed here.

Also, for software which tries to make sense of the SQLSTATE for
automated handling, I'm inclined to think that something in Class Code
'08' (Connection Exception) would be more useful than the Class Code
'55' (Object Not in Prerequisite State) value. Granted, it's a gray
area, since the problem with the connection is that it's not in an
open state....

-Kevin

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2009-11-19 00:59:57 Re: commit and rollback don't throw exceptions when they should
Previous Message Kris Jurka 2009-11-18 14:29:50 Re: BUG #5177: Concurrency problem in AbstractJdbc23PooledConnection