Hey ! I have been using using WebFaction for a few months to host a Django project hooked to a PostgreSQL via Psycopg2.
I tried to replicate my production configuration on my local dev machine but just hit a wall:
Everything is working fine but postgreSQL is keeping all my non-modifying database queries opened ("idle in transaction"). So I get dozen of idle transactions really quickly.
I made some searches and apparently Django/psycopg2 is making a transaction for every query but is not making the commit/rollback for "SELECT only".
What's boggling me is that in production on WebFaction there is apparently no such problem. I found different fixes online but they looked a bit dirty.
I was wondering what technique is used on WebFaction or if my question is irrelevant.
Are you using the exact same versions of Django, Postgres and Psycopg2 locally? Normally issues with the Django ORM mechanics is due to an outdated version of Django or another library in the ORM stack.
answered Feb 13 '12 at 19:33
I miss diagnosed my issue. I had a blocking call in a Django view creating those idle transactions.
Sorry that I wasted your time and thanks for your help
answered Feb 14 '12 at 03:37