pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Maxime Lévesque <maxime.levesque@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: why do some failure spoils the jdbc connection ?
Date: Sat, 1 May 2010 11:31:44 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.1005011129500.2171@leary.csoft.net> (raw)
In-Reply-To: <y2n554f5f781005010811p573b5e6ejac0282dbb0a79699@mail.gmail.com>
References: <y2n554f5f781005010811p573b5e6ejac0282dbb0a79699@mail.gmail.com>



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



view thread (2+ messages)

Message-ID: <alpine.BSO.2.00.1005011129500.2171@leary.csoft.net>
Permalink:  ../alpine.BSO.2.00.1005011129500.2171@leary.csoft.net/
Also on:    postgresql.org/message-id/alpine.BSO.2.00.1005011129500.2171@leary.csoft.net

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, maxime.levesque@gmail.com
  Subject: Re: why do some failure spoils the jdbc connection ?
  In-Reply-To: <alpine.BSO.2.00.1005011129500.2171@leary.csoft.net>
  References: <y2n554f5f781005010811p573b5e6ejac0282dbb0a79699@mail.gmail.com> <alpine.BSO.2.00.1005011129500.2171@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox