Re: Xn block abort exceptions: BUG+PATCH

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: KB Sriram <kbs(at)snapfish(dot)com>
Cc: "'pgsql-jdbc(at)postgresql(dot)org'" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Xn block abort exceptions: BUG+PATCH
Date: 2001-02-12 11:45:49
Message-ID: 981978349.3a87cceda8220@webmail.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Quoting KB Sriram <kbs(at)snapfish(dot)com>:

> I'm using the 7.0.3 release JDBC driver, and observed that when
> Postgres aborts the transaction because of a problem within a
> transaction block, SQLExceptions are not always thrown from the
> driver on further queries within that block.
>
> For example: say I have a table
> create table x (pk int4 primary key);
>
> I then start a transaction block and insert two duplicate keys
> con.setAutoCommit(false);
> Statement s = con.createStatement();
> s.executeUpdate("insert into x values (1)"); // works fine
> try {
> s.executeUpdate("insert into x values (1)"); // raises a duplicate
> key
> SQLException
> } catch (SQLException sqle) { sqle.printStackTrace(); }
> s.executeUpdate("insert into x values(2)"); // no exception thrown
>
> Looking into the code, it looked as though the *ABORT STATUS* message
> in the protocol was being ignored in the driver. I've attached a patch
> (against the 7.0.3 driver) of the changes that made it work better
> for me.

I'm away from the source at the moment, but I'll check this one out. I'm not
sure but there may have been a fix for this already (can't be certain).

Peter

--
Peter Mount peter(at)retep(dot)org(dot)uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Peter T Mount 2001-02-12 11:49:00 Status of JDBC web site
Previous Message Michael Ansley 2001-02-12 10:40:59 DB Arrays in the JDBC driver