Re: why do some failure spoils the jdbc connection ?

From: Kris Jurka <books(at)ejurka(dot)com>
To: Maxime Lévesque <maxime(dot)levesque(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: why do some failure spoils the jdbc connection ?
Date: 2010-05-01 15:31:44
Message-ID: alpine.BSO.2.00.1005011129500.2171@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Sat, 1 May 2010, Maxime L?vesque wrote:

>  When I execute some statements, for example droping a constraint and
> the constraint doesn't exist, an exception gets thrown as expected. If I
> issue another statelemt via the same connection, I get another exception
> saying the transaction is canceled, in other words, the connection is no
> longer useable.
>
>  Is the re a way that I can concinue using the connection ?
>

Yes, by creating a Savepoint around statements that may fail and rolling
back to that Savepoint if an exception occurs.

http://java.sun.com/javase/6/docs/api/java/sql/Connection.html#rollback%28java.sql.Savepoint%29

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2010-05-01 15:45:17 Re: How to ensure that SSL is enabled?
Previous Message Maxime Lévesque 2010-05-01 15:11:53 why do some failure spoils the jdbc connection ?