On Jun 15, 6:59 pm, Michael Bayer <mike...@zzzcomputing.com> wrote:
> So no, calling gc.collect() is not necessary under normal circumstances, it 
> is only needed here to for the purposes of the method of testing.

Ok, thanks. I've done some more digging and find that there *are* some
references knocking around, but not sure of an easy way of getting rid
of them. The SessionTransaction which is created in
SessionTransaction.close() hangs around because it is referred to by
an orm.session.Session instance, which in turn is referred to by
various orm.query.Query objects which are used to populate comboboxes
earlier in the request processing. These comboboxes are generated
using some widget classes which hold references to the queries which
populate them - and I want these widget->query connections to persist
across requests because they codify e.g. specific orderings for the
combobox entries. So it seems that I should break the connection
between these query objects and the orm.session.Sessions they use, in
the HTTP request cleanup code where I am doing the
scoped_session.remove() calls. Of course at that point I don't have a
clear view of what widgets/queries were used in rendering the response
- so what would be a reasonably easy way of ensuring everything's
cleaned up? I don't believe that what I'm doing is a particularly
uncommon pattern.

Thanks & regards,

Vinay Sajip

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to