From: Bart Samwel <bart@samwel.tk>
To: Ludek Finstrle <luf@pzkagis.cz>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Future development
Date: Wed, 22 Mar 2006 13:38:41 +0100
Message-ID: <44214551.5060202@samwel.tk> (raw)
In-Reply-To: <20060322112325.GD6294@soptik.pzkagis.cz>
References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4011C9594@ratbert.vale-housing.co.uk>
<441AB081.9090901@samwel.tk>
<20060322112325.GD6294@soptik.pzkagis.cz>
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
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.
Another example of a situation where the per-statement rollback on
errors is wanted. Situation sketch: we have a client-side object model
with a generic persistence layer that stores the objects in a SQL
database. When we save changes, we try to store all of the objects
WITHOUT deferring constraints, even though there may be circular
references etcetera. The reason for not deferring constraints is that we
want to be able to tell the user which objects are the cause of
constraint violations, something which isn't possible when you simply
get "constraint XXX violated" at commit time. So, what we do is, we try
to store every object, skipping any that fail, then we try the failed
ones again, as long as the set of objects gets smaller. Then only at the
end do we try and defer constraints in order to store the last ones. But
if we can't deliberately try statements, knowing that they might fail
(atomically), this doesn't work. It works on all other databases that we
support, it works on PostgreSQL with the 7.03 driver with "Level of
rollback on errors" set to "Statement", it just doesn't work with the
8.01 driver because it will force us to roll back the transaction.
Cheers,
Bart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: bart@samwel.tk, luf@pzkagis.cz
Subject: Re: Future development
In-Reply-To: <44214551.5060202@samwel.tk>
References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4011C9594@ratbert.vale-housing.co.uk> <441AB081.9090901@samwel.tk> <20060322112325.GD6294@soptik.pzkagis.cz> <44214551.5060202@samwel.tk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox