10 Jun
2007
10 Jun
'07
5:34 p.m.
All, I'm using t.e.adbapi with psycopg against a Postgres 8 database. This database is replicated using Slony-I and I'm hitting this problem: http://linuxfinances.info/info/faq.html#AEN45927 Basically, holding open SQL connections for a long time causes postgres to cache query plans; these cached plans need to be freed for Slony to rollover its internal SQL replication log table. So I'd like to add something to ConnectionPool to disconnect unused connections after a certain time. Any suggestions how to start? Also - looking at the ConnectionPool/Transaction code, it appears a ConnectionPool's "connections" dictionary is modified from multiple threads without locking. Is this safe?