[Zope] Help on synchronous methods?

Craig Allen cba@mediaone.net
Wed, 07 Jun 2000 18:56:46 -0400


How can I synchronize external method completion with DTML method invocation?
[and do I need to?]

I found an unexpected bug in a Zope content management app I am developing: the
actual publishing process invokes an External Method that uses urllib and ftplib
to pull rendered documents from Zope and PUT them to a web server via FTP.  One
of the documents is a table of contents of the "current" documents, which is
generated dynamically by a DTML method that looks at a property of each document
in the folder.  The last step in the publishing process is "archiving", a DTML
method that clears the "current" property in all documents.

What appeared to be happening was that the external method was still chugging
along when it came time to grab the table of contents; meanwhile, the archive
method had already cleared the "current" property, so there were no documents
listed in the table of contents.

First question: is my hypothesis likely?  Are methods - in particular an
external method - executed strictly sequentially (which is what I would have
assumed) or is it possible that the DTML archive method could have completed
before the prior external method did?  

Second question: if methods are _not_ executed synchronously, is there any way I
can force them to be?

Hoping-my-conclusions-are-wrong-not-my-assumptions-ly yours,
Craig
-- 
Craig Allen  - Managing Partner - Mutual Alchemy
Web Architecture - http://alchemy.nu