* Christian Boos <[email protected]> [2009-11-29 10:27]:
> > I can reproduce it with just a one request, 100% of time, so it is
> > either something really stupid or really bad setup somewhere.
> > I'll debug it more next week.
[...]
> So... scratch the "This should work..." from my previous mail, this
> should actually *not* work.
> You have to keep a reference to the db connection while working with a
> cursor.
Ahh, cool, thanks for info. I tried with a clean environemnt and I started
blaming debian meanwhile ;P
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.
greets
silk
--
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.
diff --git a/trac/ticket/roadmap.py b/trac/ticket/roadmap.py
index d2684f1..57eb6a5 100644
--- a/trac/ticket/roadmap.py
+++ b/trac/ticket/roadmap.py
@@ -195,7 +195,8 @@ class DefaultTicketGroupStatsProvider(Component):
for s in all_statuses:
status_cnt[s] = 0
if total_cnt:
- cursor = self.env.get_db_cnx().cursor()
+ db = self.env.get_db_cnx()
+ cursor = db.cursor()
str_ids = [str(x) for x in sorted(ticket_ids)]
cursor.execute("SELECT status, count(status) FROM ticket "
"WHERE id IN (%s) GROUP BY status" %