Skip site navigation (1) Skip section navigation (2)

Re: JDBC squirrely transaction behavior??

From: Joachim Achtzehnter <joachim(at)kraut(dot)bc(dot)ca>
To: Steve Wampler <swampler(at)noao(dot)edu>
Cc: postgres-interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: JDBC squirrely transaction behavior??
Date: 2000-06-05 16:26:36
Message-ID: Pine.LNX.4.21.0006050919100.19799-100000@penguin.kraut.bc.ca (view raw or flat)
Thread:
Lists: pgsql-interfaces
Today, in a message to postgres-interfaces, Steve Wampler wrote:
> 
> Hmmm, that may cause me a problem in a similar situation - I want to
> do an update whenever an insert fails.

There was a discussion about this in several Postgresql mailing lists a
few weeks ago. Postgresql currently doesn't support statement-level abort
and instead aborts the whole transaction. Apparently, there is a consensus
among the developers that statement-level abort is a good thing to
have. Perhaps we will see it some day...

Even now you can do this trick the other way around: do an update first,
and when the row count is zero insert the row instead. This works because
updating zero rows is not an error in SQL. Not sure whether this helps in
your situation.

Joachim

-- 
work:     joachima(at)realtimeint(dot)com  (http://www.realtimeint.com)
private:  joachim(at)kraut(dot)bc(dot)ca       (http://www.kraut.bc.ca)


In response to

pgsql-interfaces by date

Next:From: Gregory Krasnow OpenSourceCRMDate: 2000-06-05 17:46:18
Subject: RE: Postgres 7.0 JDBC - update count for DELETE is always 1
Previous:From: Steve WamplerDate: 2000-06-05 15:37:44
Subject: Re: JDBC squirrely transaction behavior??

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group