[Zope] MySQL Threading

Tino Wildenhain tino at wildenhain.de
Tue Dec 23 13:10:18 EST 2003


Hi Ralph,

Ralph vd Houdt wrote:
> Hi All,
> 
> I'm currently writing an application in which an report-page is based on a
> heavy SQL query. The query runs about 15 seconds (the result will be stored
> in a session). For this reason I want to create a waiting page which checks
> if the SQL query has finished running. Does anybody know if I can run the
> SQL query in a separate thread and redirect to the report-page when the
> query has finished (by polling the thread). The results will be read from
> the session and used in the report-page.

Forget about all the threading issue. Even if you would manage to get it
work in Zope, tt will not fit into HTTP call model.

The solution is quite easy:

1.) simple javascript switches style in your page to change form to
     a waiting page and then submits information.
     User would see waiting page until information returns from database
     and zope

2.) without Javascript, you call a simple waiting page, maybe with
     anim gif or message, and in the page you have
     <meta http-equiv="refresh" value="0; 
http://url/to/db_search_page?paramaters">
     It only works with http-equiv headers, not with real HTTP header
     as of response.setHeader().
     The next request starts immediately after loading the waiting page
     and the user sees the waiting page until 2nd call to zope returns.


For the 2nd solution you should provide a link (maybe with the anim gif)
to the data page, in case someone disabled redirects and is waiting
forever then.

Regards
Tino Wildenhain




More information about the Zope mailing list