On Thursday 19 June 2008 01:43:16 Arun Kumar PG wrote:
> one more point that i forgot to mention in the workflow, so i
> re-wrote it again:
>
> - search request comes
> - if orm mapping is not created it's get created now (only happens
> one time) - new session is created using
> orm.create_session(weak_identity_map=True). now this new session is
> added to a python dict like this:
>
> resources = {
>   SESSION: session
>   OTHER_RESOURCE: obj
> }
>
> and then this resources dict is attached to the current request
> thread (this is done so that different DAOs can access the same
> session and other resources from the current thread).
> - all orm queries are fired.. results processed
> - finally, current thread is accessed again and tear down happens
> as below:
>
> resources = currentThread().resources
> resources[SESSION].clear()
> del resources
> my question is that i am deleting resources dict but not
> resources[SESSION] (session object) which might be being pointed to
> by sa data structure associated as a part of initial
> orm.create_session call? i have not done a deep dive in sa source
> code but just guessing.

so never delete that session? and that thread.resources thing?
do u have non-pure-python objects involved? 
it's easy to forget a reference in there.
also (repeating) check for caches. OR things the were not intended to 
be caches but actualy became/are (anything that lives forever is a 
candidate)

it's up to you, noone can do the dirty work...

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