[Zope-dev] RE: your mail

Randall F. Kern randy@spoke.net
Mon, 9 Apr 2001 17:08:21 -0700


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 =3D a + 1
update foo set a =3D 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
>=20
>=20
> Scavenging the mail folder uncovered Randall F. Kern's letter:
>=20
> [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=20
> transaction, the second
> > transaction will fail with a "concurrent update" error.
>=20
> 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=20
> it in zope.
> do you know how much faster would it be compared to the=20
> serialized mode?
>=20
> > Given that the default transaction mode for these DAs is=20
> 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.
> >=20
> > I've been running this way for a few days, and everything=20
> seems great.
> > Any reasons why this might be good/bad/ugly very welcome. =20
> (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=20
> at commit time
> > now)
> >=20
> > Here is a small patch to ZPsyccopgDA 0.5.1 that implements=20
> this change:
>=20
> thank you very much for the patch. i am waiting to know what=20
> others think
> about it (i am not a ZODB expert) before we incorporate it.
>=20
> ciao,
> federico
>=20
> --=20
> Federico Di Gregorio
> MIXAD LIVE Chief of Research & Technology             =20
> fog@mixadlive.com
> Debian GNU/Linux Developer & Italian Press Contact       =20
> fog@debian.org
>                            Don't dream it. Be it. -- Dr.=20
> Frank'n'further
>=20