[Zope] Lock and Transaction in Zope.
Aitor Grajal
Aitor.Grajal@teleline.es
Wed, 06 Sep 2000 15:51:10 +0200
--=====_9682482706334=_
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
I think I know how to manage transactions in Zope, but I don't know how to=
lock Zope resources for multiple requests.
For example :
I have a DTML Method, called "transac1", which looks like this :
<dtml-if "var=3D=3D0">
<dtml-call wait_10_seconds>
"waiting 10 seconds..."
<dtml-call "manage_editProperties({'var':1})">
</dtml-if>
wait_10_seconds is an External Method that sleeps for 10 seconds.
In the other hand, I have another method, called "transac2" :
<dtml-if "var=3D=3D0">
<dtml-call "manage_editProperties({'var':2})">
<dtml-else>
<dtml-call "manage_editProperties({'var':3})">
</dtml-if>
In the parent Folder, there's a property called "var" which I use in these=
methods. It has an initial value of 0.
The point is : if I call the first method, and while it's sleeping, I call=
the second one (from another window, for example), it doesn't work=
properly. The first one crashes, and doesn't finish right. The final "var"=
value is 2.
I want to know if there is any way to lock the folder, and its properties,=
so no one can access to it until my method "transac1" finishes, and where=
can I find information about locking resources in Zope.
--=====_9682482706334=_
Content-Type: text/html; charset="us-ascii"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META content="MSHTML 5.00.2920.0" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff style="FONT-FAMILY: Arial" text=#000000>
<DIV><FONT size=2>I think I know how to manage transactions in Zope, but I don't
know how to lock Zope resources for multiple requests.</FONT></DIV>
<DIV><FONT size=2>For example :</FONT></DIV>
<DIV><FONT size=2>I have a DTML Method, called "transac1", which looks like this
:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2><dtml-if "var==0"><BR> <dtml-call
wait_10_seconds><BR> "waiting 10 seconds..."<BR> <dtml-call
"manage_editProperties({'var':1})"><BR></dtml-if><BR></FONT></DIV>
<DIV><FONT size=2>wait_10_seconds is an External Method that sleeps for 10
seconds.</FONT></DIV>
<DIV><FONT size=2>In the other hand, I have another method, called "transac2"
:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><dtml-if "var==0"> <BR> <dtml-call
"manage_editProperties({'var':2})"><BR><dtml-else><BR>
<dtml-call
"manage_editProperties({'var':3})"><BR></dtml-if></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>In the parent Folder, there's a property called "var" which I
use in these methods. It has an initial value of 0.</FONT></DIV>
<DIV><FONT size=2>The point is : if I call the first method, and while it's
sleeping, I call the second one (from another window, for example), it doesn't
work properly. The first one crashes, and doesn't finish right. The final "var"
value is 2.</FONT></DIV>
<DIV><FONT size=2>I want to know if there is any way to lock the folder, and its
properties, so no one can access to it until my method "transac1" finishes, and
w</FONT><FONT size=2>here can I find information about locking resources in
Zope.</DIV></FONT></BODY></HTML>
--=====_9682482706334=_--