Re:

From: Daniel Serodio <daniel(at)checkforte(dot)com(dot)br>
To: Dave Cramer <Dave(at)micro-automation(dot)net>
Cc: PostgreSQL JDBC List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re:
Date: 2002-11-05 17:37:38
Message-ID: 1036517863.13292.30.camel@kelly
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, 2002-11-05 at 15:25, Dave Cramer wrote:
> Unfortunately, until the backend gives us usefull error codes, there's
> not much we can do about catching exceptions intelligently.

Well, at least in this particular situation, the backed raises a NOTICE
"current transaction is aborted, queries ignored until end of
transaction block". Maybe the driver can use this notice to give a more
meaningful exception message?

> And yes, the behaviour is intended, once a transaction has failed, you
> need to end, or roll it back

I just read Csaba's reply to my previous post, and now I have a better
understanding of this. We can't do much about it if the backend doesn't
support savepoints, right?

> Dave
> On Tue, 2002-11-05 at 12:19, Karl Goldstein wrote:
> > I don't have a strong opinion either way. For me, the main problem with the current behavior is
> > simply that the error message is confusing. If it is indeed the case that any SQLException
> > invalidates the current transaction (and my impression is that this is not intended), then the
> > driver should report that directly and not even let you try to execute later statements. The "No
> > results were returned by the query" error just left me scratching my head.
> >
> > Thanks,
> >
> > Karl
> >
> > --- Daniel Serodio <daniel(at)checkforte(dot)com(dot)br> wrote:
> > > I've never worked with Oracle, just MySQL and PostgreSQL, but isn't this
> > > the definition of a transaction?
> > >
> > > "A transaction is an atomic unit of processing; it is eigher performed
> > > in its entirety or not at all"
> > >
> > > My understanding of this is that if one statement failed, all of the
> > > following statements should fail.
> > >
> > > On Tue, 2002-11-05 at 14:31, Csaba Nagy wrote:
> > > > Hi all,
> > > >
> > > > I was wondering if there's any chance of this behavior to change in the
> > > > future ?
> > > > I mean will it be possible to continue a transaction after one of the SQLs
> > > > failed, by only rolling back what that query did ?
> > > > In many real life applications recovery is very possible after a failed
> > > > query, and (the not failed part of) the transaction should be committed.
> > > > This is one of the big differences in behavior between Postgres and Oracle,
> > > > making life hard for porting...
> > > >
> > > > Cheers,
> > > > Csaba.
> >
> > __________________________________________________
> > Do you Yahoo!?
> > HotJobs - Search new jobs daily now
> > http://hotjobs.yahoo.com/
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> > http://archives.postgresql.org
> --
> Dave Cramer <Dave(at)micro-automation(dot)net>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
--
[]'s
Daniel Serodio

In response to

  • Re: at 2002-11-05 17:25:36 from Dave Cramer

Responses

  • Re: at 2002-11-06 00:09:56 from Tom Lane

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2002-11-05 17:57:37 Re:
Previous Message Karl Goldstein 2002-11-05 17:35:06 Re: