On Jul 13, 2007, at 2:27 AM, Arun Kumar PG wrote:

> I create an orm session as soon as the request comes in and store  
> the reference to the same in the curent thread i.e.  
> threading.currentThread().session = new_session. This session is  
> stored in the current thread so that I can get the same session  
> across all DAO objects. so basically ever DAO in the request chain  
> can simply get the session by saying  
> threading.currenrThread.session and use it. Finally, once the  
> request is over this session object is removed from the current  
> thread i.e. del <session>.
>
> I can see that during multiple request the thread ids are different  
> so I believe that all of them are having their own copy of session.  
> Further, I am using pool module of sqlalchemy from where a  
> connection is returned to orm session.
>
> My guess is that somewhere in that connection management things are  
> getting schewed up -

there was a bug like this at one time in the pool, but it was fixed  
probably a year ago, and nobody has reported this issue since.  are  
the objects which you load from the session being shared between  
threads ?  i.e. a second thread issues a lazy-load operation on an  
object's attribute ?  that counts as multi-threaded session access.



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