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

Richard Barrett R.Barrett@ftel.co.uk
Fri, 08 Feb 2002 14:24:51 +0000


At 11:12 08/02/2002 +0500, Alexei Ustyuzhaninov wrote:
>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.

How so peculiar?


> > 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?

I do not know if it is still upd to date but you could try the material 
here: http://www.zope.org/Documentation/Developer/Models/ZODB/

>--
>Alexei
>