[Zope] long computations

Michel Pelletier michel@digicool.com
Fri, 2 Jul 1999 13:52:11 -0400


> -----Original Message-----
> From: Robin Becker [mailto:robin@jessikat.demon.co.uk]
> Sent: Friday, July 02, 1999 11:49 AM
> To: zope@zope.org
> Subject: [Zope] long computations
> 
> 
> I have a problem with a particularly cpu/memory intensive calculation.
> The current server implementation is in Tcl (tclHTTPD) and uses Python
> as the calculation engine in a separate process. To avoid 
> running out of
> memory I implemented the calculation as a server and just add 
> jobs to a
> server queue. The tclHTTPD implementation allows me to keep the server
> busy as http requests come in and to resume pages when jobs are
> finished.
> 
> I can see how to implement most of the logic in Zope2 (assuming each
> request is in a separate thread), but how can I handle the 
> case when the
> request is prematurely aborted. In my existing implementation I detect
> this when the http socket becomes readable and then do a cleanup to
> remove the request from the queue.

You can raise an error at any point in a request and it will abort the
transaction, and nothing will get commited to the database.  Note that
this effect holds true for the <!--#raise--> tag also.

-Michel

> -- 
> Robin Becker
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (For developer-specific issues, use the companion list,
> zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>