[Zope] Concurrency/Atomicity in ZSQL/ZOracleDA ?

Thomas B. Passin tpassin@mitretek.org
Fri, 22 Mar 2002 12:15:52 -0500


If it's a low volume page as you have said, the chances of having an id
collision are small anyway.  You could always use a random number instead of
a sequentially numbered id, that would reduce the chances of a collision
enormously.

Cheers,

Tom P


[Renaud Guérin]

> >I think I need to lock the table against reads, not inserts.
> >What I must ensure is that no more select's max(id)+1 can be done
> before the
> >subsequent insert is completed.
> >I don't know how to use LOCK to do that, anyone ?
> You want   LOCK TABLE table IN EXCLUSIVE MODE;   most likely.  A second
> lock statement will block until the first one clears.

damn, just read this:
"A lock never prevents other users from querying the table. A query never
places
a lock on a table. Readers never block writers and writers never block
readers. "

(http://download-west.oracle.com/otndoc/oracle9i/901_doc/server.901/a90125/s
tatements_915a.htm)

So I guess that leaves me for good with only the sequence option, unless
there's
something we didn't think of...