[Zope] How to prevent concurrent access to the same object?

Alexei Ustyuzhaninov aiu@quorus-ms.ru
Fri, 08 Feb 2002 11:12:41 +0500


Richard Barrett wrote:

 > At 10:15 06/02/2002 +0500, Alexei Ustyuzhaninov wrote:
 >
 >> Hi!
 >>
 >> Is it possible to make a zope object which doesn't allow simultaneous
 >> access to itself? I mean that if two users call methods of the same
 >> object then only one call will process at a time and the other one
 >> will wait untill the first call will finish. I tried to fix it up with
 >> unix semaphores but with no success.
 >
 >
 > Why do you want to do this so explicitly?
 >
 > I believe that Zope is inherently transactional and its own database
 > updates are performed atomically with transaction commit, abort,
 > rollback and retry apparatus built in.

BTW is there any method to monitor zope transactions? My experience is
that they have quite peculiar behaviour.

 > That said, you might want to ask how to plug in your own commit,
 > rollback and retry code to zope's transaction commit and abort handlers
 > if you problem is to control updating of some external database from
 > zope code.

I think you are right though I don't need sterling transactions in my 
objects. I need simple locks.

So, could somebody advice how to plug in extra code to the zope 
transaction machinery?

-- 
Alexei