On Jul 15, 2007, at 11:24 PM, Arun Kumar PG wrote:

> Hi Michael,
>
> I figured out the problem. It was a connection sharing issue. Looks  
> like different connection objects were getting returned from the  
> pool (which was created using the creator approach in create_engine 
> ()) when relations were getting loaded as a part of processing. Due  
> to this sometimes connection swapping was happening among the  
> different request threads.

do you mean, multiple create_engine() calls were occuring ?  or are  
you talking about the issue i mentioned earlier, that lazy-loaders  
were firing off against a session in a different thread ?  does that  
mean your mapped objects *are* in fact being used in threads other  
than where they were created ?

>
> I resolve this I created a threadsafe QueuePool and passed a class  
> wrapping the same while creating engine. This helps the same  
> connection getting returned for the same thread.

can you please describe specifically what you mean here ?  QueuePool,  
i would hope, is threadsafe already.  Or do you just mean you passed  
the "threadlocal" flag to QueuePool ?  that doesnt seem like it would  
fix the session-related problem since that issue occurs when it holds  
onto a single connection while flushing.

i just need to understand what you did, since if theres any way i can  
defensively prevent or at least document the situation its pretty  
important.





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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