I've been working with Turbogears for a few months now, and one topic
that has always been a guess for me is how to properly handle
SQLAlchemy session objects. The webapp I'm working on now takes user
input and constructs SQLAlchemy queries that can take some time to
return. The way I currently have it structured is what I thought was
the "correct way." That is, I have the DBSession object defined in my
model, and in each controller I do: from webapp.model import
DBSession, session = DBSession(), session.query(..)... etc. I noticed
that if I go to a page and execute a long query, it hangs the whole
app. That is, if I (in a new tab) try to go to a page that is plain
HTML (I dropped it in public/test.html, so it doesn't even have an
associated controller), the HTML page doesn't load until after the
database query is complete. I guess I'm doing something wrong -- but
does anyone have some suggestions / advice?

Now this next issue is a more general question. Even if I close the
page that is executing the long query, the webapp still hangs until it
is complete, at which point I get a broken pipe error from paster.
This is probably not possible, but is there any way to kill the
query / stop the controller from finishing if the user closes the
page?

Thanks,
Adrian

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to