Read committed is faster, but I have not done any tests to know how much faster. Read committed mode doesn't support concurrent updates either, but fails silently. In other words, given to concurrent queries: update foo set a = a + 1 update foo set a = a + 2 Assuming these overlap, and a starting value of 0 for "a", read committed mode would result in "a" either being 1 or 2; serializable mode (with my patch) would result in "a" getting set to 3. -Randy
-----Original Message----- From: Federico Di Gregorio [mailto:fog@mixadlive.com] Sent: Monday, April 09, 2001 1:23 AM To: Randall F. Kern Cc: zope-dev@zope.org Subject: Re: your mail
Scavenging the mail folder uncovered Randall F. Kern's letter:
[snip]
Concurrent updates are not supported in the serializable transaction mode; if one transaction tries to update (or delete) a row that has already been updated by a concurrent uncommitted transaction, the second transaction will fail with a "concurrent update" error.
mmm... are they supported in the read commited mode? if yes it will be easy to add this mode as on option to psycopg cursors and use it in zope. do you know how much faster would it be compared to the serialized mode?
Given that the default transaction mode for these DAs is Serializable, and Zope has this nifty support for ConflictErrors and retrying transactions already, I propose Postgres DAs should convert the concurrent update serialization errors into ConflictErrors automatically.
I've been running this way for a few days, and everything seems great. Any reasons why this might be good/bad/ugly very welcome. (Like: is it safe to throw a ConflictError at any random time during processing?
From a quick glance at ZODB it seems they are only thrown at commit time now)
Here is a small patch to ZPsyccopgDA 0.5.1 that implements this change:
thank you very much for the patch. i am waiting to know what others think about it (i am not a ZODB expert) before we incorporate it.
ciao, federico
-- Federico Di Gregorio MIXAD LIVE Chief of Research & Technology fog@mixadlive.com Debian GNU/Linux Developer & Italian Press Contact fog@debian.org Don't dream it. Be it. -- Dr. Frank'n'further