Re: Future development - Mailing list pgsql-odbc

From Bart Samwel
Subject Re: Future development
Date
Msg-id 4421625A.7030906@samwel.tk
Whole thread Raw
In response to Re: Future development  (Ludek Finstrle <luf@pzkagis.cz>)
List pgsql-odbc
Ludek Finstrle wrote:
> Hello
>
> I copy&paste here second thread which is related to this:
>
>>> This is backend related. I assume you use autocommit=off. In this
>>> case backend doesn't allow next commands after failed one in
>>> one transaction.
>> I get what autocommit does when I haven't started a transaction, but
>> what does "autocommit" mean when I'm inside a manually started transaction?
>
> When you start transaction manually you have to finish it manually.
> I see no difference in ending transactions.

ACK.

>>> 08.00.0102 driver calls automatic rollback (if I remember it right).
>>> Some users voted againist it. And I agreed with them. When programmer
>>> manage the transaction he may also manage errors.
>> Yes. But that also means that he needs to get a choice on whether to
>> continue or not. The 8.01 driver forces the programmer to rollback,
>> which is not very nice.
>
> You have the choice. You could use savepoints (this is the way used by
> 7.3 experimental driver). When driver uses savepoints automatically
> before each statement it has to be slow down.

Of course it will be slightly slower. But I think savepoints are not
that slow, their big cost is at rollback time. At least it's nice to
have it as an option, as in the 7.3 driver.

>>> I see no reason to continue transaction when something in it failed.
>>> Transaction may be atomic. All inside is ok or no change happens.
>>> It sounds quite odd for me that another RDBMS do it another way.
>> Well, on other DBMSes the statements themselves seem to act like small
>> transactions themselves. If a single statement fails, you can try and
>> finish your transaction in another way, or you can roll it back. Your
>> choice.
>
> Ok. You're right. I have used too strong words.

Glad you see things my way. ;-)


> Wed, Mar 22, 2006 at 01:38:41PM +0100, Bart Samwel napsal(a):
>> Ludek Finstrle wrote:
>>>> I for one can't live without the "Level of rollback on errors" feature
>>>> of the 7.3 experimental branch. I don't care about which branch is used,
>>>> as long as this feature is in there -- the 8.1 branch doesn't work for
>>>> me at all. :-/
>>> Could you explain me the "Level of rollback on errors"? I think that
>>> when programmer doesn't use autocommit mode he want react on errors
>>> himself.
>> Like I said in my other message, the 8.01 driver doesn't give me a
>> choice in how to react on errors at all: it forces me to rollback the
>
> It gives you the choice ;-) but not hidden one.

You mean I can set savepoints manually. :-)

>> complete transaction. I want to have a choice in that. The 7.03 driver
>> allows me to set the "Level of rollback on errors" to "Statement", which
>> means that only the failed statement is rolled back, and *I* then have
>> the choice of whether I want to rollback the remainder of the
>> transaction as well, or that I want to continue / try something else.
>
> Maybe this could be good for writing DB applications for more RDBMS?

For portability it would definitely be nice if the driver supports the
other RDBMS drivers' behaviour.

> Thanks for disscussion (I hope we will continue). You show me another
> point of view.

I'll keep an eye on the discussion. Pointing it in the right direction
can save me a whole lot of work later. :-)

--Bart

pgsql-odbc by date:

Previous
From: Ludek Finstrle
Date:
Subject: Re: Database backend (7.4 versus 8.0) trouble ?
Next
From: Tom Lane
Date:
Subject: Re: Future versions of psqlODBC