[Grok-dev] Interrupted request. Is there any way to find?

Hector Blanco white.lists at gmail.com
Mon Jan 3 18:43:17 EST 2011


Hello list!

I am using REST to perform some GET/POSTS... as explained
http://grok.zope.org/documentation/how-to/rest-support-in-grok .

My data is serialized using MySQL (and SqlAlchemy 0.6.5 over it). The
GETs, POSTs fire some queries to a MySQL database (as mentioned, using
SqlAlchemy over it) but if the connection is interrupted (the client
presses F5 or Ctrl+F5 in his browser to reload the page) it really
messes up the server (connection closed, invalid queries... sometimes
I even get a core dump and the server... dies). I think I could
improve it if I was able to stop an interrupted request before it
starts querying the database. So here it goes (the question):

> Is there any way to know if the request is "alive" / "valid"...? (basically if the user is trying to refresh the page)

I've been trying to get something I could use in the HTTPRequest
documentation (from Zope)

http://docs.zope.org/zope3/Code/zope/publisher/http/HTTPRequest/index.html

but I don't see anything I can use...

Thank you in advance!


More information about the Grok-dev mailing list