On May 4, 2008, at 10:59 AM, Paul Johnston wrote:
> Hi,
>
> I'm writing a ToscaWidget to do a kind of data grid. The way I've
> designed it so far, you pass an SA query object to the Widget when
> it's created. Then, each time it's displayed, it applies a few extra
> filters to the query and fetches the results. I'm using scoped
> sessions, and the query ends up being used in several different
> threads.
>
> My initial thoughts are that there could be thread safety problems
> with this approach, although in practice it works just fine. How bad
> are the threading issues? And is there anything I can do to fix it,
> e.g. a step that clones a query and attaches it to the session for
> the current thread?
>
ive thought about this, and the Query is not in fact tied very hard to
a partcular Session (or at all). I think it would be workable for us
to add a "using_session()" method to it, i.e.:
q = Query(User)
print q.using_session(somesession).all()
I sort of thought we had already done this at some point, or proposed
it, and I'm not sure why it didn't actually happen.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---