Re: [Zope] Lock and Transaction in Zope.
Hi Aitor, (I am posting to the Zope mailing list, too.) >I have Zope in W2000 >Zope 2.2.1 >Internet Explorer 5.0 Ok. I just tried with Zope on Linux, after I tried with Zope on Windows 98. RedHat 6.2 Zope 2.1.6 Internet Explorer 5.0 Guess what? The thread did not hang. The long thread returns, but the value of your "var" was 2. The situation is then: (1) For Zope running on Windows, the long thread hangs and never returns anything to the browser. (2) For Zope running on Linux, the long thread gets into transaction conflict. But Zope was smart enough to abort the transaction and restart the request again. (Just like what other people said.) I think this should be considered as a bug in Zope for the Windows platform. We should submit the bug report to the Zope bug collector. Notice that it happens for Zope 2.1.6 and Zope 2.2.1, I wonder why no one has reported this bug... (or has it been reported but not been fixed?) regards, Hung Jung _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Lock and Transaction in Zope.
Zope has no built in locking like that, but IIRC there was some hack in the wiki code to prevent simultaneous editing (which wasn't bullet proof). Perhaps you can look there. I doubt whether it will solve the problem you pose, but I don't see why you'd want to do what you pointed out in your mail anyway. Rik ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Lock and Transaction in Zope.
Aitor Grajal writes: > --=_9682482706334=_ > Content-Type: text/plain; charset="ISO-8859-1" > Content-Transfer-Encoding: quoted-printable I hate "multipart" or encoded messages to this list (because the digest removes MIME headers (what a stupidity!) and does not give my mail reader a chance to decode them). > ... two requests concurrently accessing the same object ... > The first one crashes, and doesn't finish right > I want to know if there is any way to lock ... > about locking resources in Zope. You do strange things... Zope tries hard to avoid locking and uses an optimistic collision policy instead. Several threads can run concurrently on separate copies of an object. If, during commit, a collision is detected, the affected transaction is aborted and (I think I read that) restarted. If you really need locking, you can use Pythons "threading" module (in a package used from an external method). You must be careful, though. Look in the archive for a message from Sean McGrath about the potential problem involved and my reply for a solution. You may also look (as an example) at URL:http://www.dieter.handshake.de/pyprojects/zope/SharedResource.html It uses looks to protect resources shared by several threads. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Lock and Transaction in Zope.
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 : "waiting 10 seconds..." wait_10_seconds is an External Method that sleeps for 10 seconds. In the other hand, I have another method, called "transac2" : 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.