Re: problem with new autocommit config parameter and jdbc - Mailing list pgsql-hackers

From snpe
Subject Re: problem with new autocommit config parameter and jdbc
Date
Msg-id 200209101543.24099.snpe@snpe.co.yu
Whole thread Raw
In response to Re: problem with new autocommit config parameter and jdbc  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: problem with new autocommit config parameter and jdbc  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-hackers
On Tuesday 10 September 2002 04:16 am, Stephan Szabo wrote:
> On Tue, 10 Sep 2002, snpe wrote:
> > On Tuesday 10 September 2002 03:05 am, Stephan Szabo wrote:
> > > On Tue, 10 Sep 2002, snpe wrote:
> > > > On Monday 09 September 2002 11:03 pm, Rod Taylor wrote:
> > > > > On Mon, 2002-09-09 at 17:04, snpe wrote:
> > > > > > I'm use 'autocommit=false' and have problem with psql
> > > > > > When any commnad is lost, then next commnad get error for
> > > > > > transactions (simple select command).BTW
> > > > > >
> > > > > > snpe> select * from org_ba;
> > > > > > ERROR: relation org_ba does not exists
> > > > > > snpe> select * from org_ban;
> > > > > > ERROR: current transactions is aborted, queries ignored until end
> > > > > > of transaction block
> > > > > > snpe> rollback;
> > > > > > ROLLBACK
> > > > > > snpe> select * from org_ban;
> > > > >
> > > > > Maybe I'm missing something, but isn't that the expected behaviour
> > > > > when autocommit is turned off?
> > > >
> > > > I get this every time.When exists command with error next command
> > > > don't work without explicit rollback and commit (this is not for
> > > > psql, this error get in with JDeveloper - JDBC driver).When
> > > > autocommit=ture all is fine
> > >
> > > It starts a transaction, failes the first command and goes into the
> > > error has occurred in this transaction state.  Seems like reasonable
> > > behavior.
> >
> > Select command don't start transaction - it is not good
>
> I think you need more justification than "it is not good."  If I do a
> sequence of select statements in autocommit=false, I'd expect the same
> consistancy as if I'd done
> begin;
> select ...;
> select ...;
>
Ok.You start transaction explicit and this is ok.
But simple SELECT don't start transaction.

> > Error command don't start transaction - nothing hapen, only typing error
>
> If you do an insert that violates a constraint, does that start an
> transaction or not?  I think we have to choose before we start doing the
> statement not after.
This is typeing error.Nothing happen.That is not transaction.
I don't know that is possible, but before start transaction we need parsing 
command and select or any error don't start transaction
This is problem for every client (I know for JDBC)
regards
Haris Peco


pgsql-hackers by date:

Previous
From: Daryl Beattie
Date:
Subject: Re: [JDBC] problem with new autocommit config parameter
Next
From: Tom Lane
Date:
Subject: Re: Rule updates and PQcmdstatus() issue