Re: connection/statement becomes unstable following SQLException

From: Rob Prowel <tempest766(at)yahoo(dot)com>
To: Barry Lind <blind(at)xythos(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: connection/statement becomes unstable following SQLException
Date: 2003-08-26 02:13:29
Message-ID: 20030826021329.5026.qmail@web60002.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


--- Barry Lind <blind(at)xythos(dot)com> wrote:
> Rob,
>
> There are a couple of things going on here. First
> is the way postgres
> works. One postgres gets an error, all subsequent
> sql statements issued
> in that transaction will also error. So to get
> things back to a
> normal state you need to rollback the transaction
> after any error
> occurs. So in general in postgres you can't trap an
> error and continue
> processing without first rolling back the
> transaction that errored.
>
> Also what version of the driver and database are you
> using? Have you
> tried the latest version from the
> jdbc.postgresql.org website?
>
> Finally, if you turned sql statement tracing on on
> the server you would
> be able to see exactly what was going on by looking
> at the server log files.
>
> This may be a jdbc driver bug, but it also could be
> a number of other
> things as well.
>

Thank you. This problem was in fact caused by not
doing a rollback to recover from an "Excepted"
transaction. Silly me. I figured that if the
transaction was atomic, then the rollback would be
implicit when if the transaction failed But after
considering that a single insert into an indexed table
cannot be "atomic", I now see the error of my ways.

Thanks to all who responded.

-Rob

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2003-08-26 07:10:49 Re: SQLState Implementation
Previous Message CoL 2003-08-25 21:12:41 Re: how to do a SET search_path?