In my current application I am running a rather expensive query in a
background thread, but then I need to use the results in the
foreground thread.  The object I find has a great deal of lazy
evaluated properties that link it to several other mapped objects.  As
it stands now, the application is only following the lazy properties
when it uses the object in the primary thread.  The has multiple
engines connected to multiple databases.  I have a separate session
for each database for each thread.  (Note: right now I am doing this
manually but I am debating whether I should be using something like
SessionContext.)

What I am worried about is that by querying the initial parent object
in the background thread and then using it's lazy props in the
foreground thread, I think SA is probably using the background session
to evaluate these links.

Is there a recommended way to deal with a situation like this? In
other words, what is the recommended practice for moving, reusing
objects from a session across multiple threads.  Is there some way to
remap the object and attach it to the foreground session?

-Allen

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to