Grzegorz Sobanski wrote: > * Christian Boos <[email protected]> [2009-12-04 15:52]: > >>> Attached is a patch fixing this in ticket/roadmap.py. >>> I greped for similar pattern through trac (stable-0.11) and trunk and >>> dind't find any. >>> >> Oh, good catch! >> >> This works there only because there are other references kept on that >> "db" higher in the stack (if a db is active, get_db_cnx() from within >> the same thread is guaranteed to return it), but nevertheless we should >> fix it, of course. >> > > > Hmm, without this patch my plugin is not working, with patched > roadmap.py it works ok. So I think it would be good to patch it, > for plugins using DefaultTicketGroupStatsProvider. >
I've applied the patch in http://trac.edgewall.org/changeset/8878 but as I explained, the usage Trac itself makes of that method is done in such a way there's always a connection proxy kept alive thanks to a reference higher in the call stack. I suppose this is not the case in your plugin, so it's indeed better to make it robust. I've also written a note in TracDev/DatabaseApi about this. Thanks again, -- Christian -- You received this message because you are subscribed to the Google Groups "Trac Development" 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/trac-dev?hl=en.
