views:

97

answers:

1

I'm occasionally but quite often getting an unhandled exception in cursor.execute (django1.1/db/models/sql/query.py line 2369), using psycopg2 with postgresql.

Looks like the database drops connection in some way, so Django crashes. For unhandled exception there is a ticket in Django's bugtrack (#11015), but I'm rather interested in reasons why db drops connection, not why Django doesn't catches it.

Using django's dev. server this error never happens (it runs db requests in order, concurrency never happens), so it's like it has something to do with db requests concurrency or what.

I have no access to postgresql config. or logs.

Any suggestions welcomed, maybe some postgresql tweaking, or some thoughts on how to debug this issue.

upd: looks like this question - http://stackoverflow.com/questions/393637 - addresses the same problem, but no solution provided :-(

A: 

The problem could be mainly with Imports. Atleast thats what happened to me. I wrote my own solution after finding nothing from the web. Please check my blogpost here: Simple Python Utility to check all Imports in your project

Ofcourse this will only help you to get to the solution of the original issue pretty quickly and not the actual solution for your problem by itself.

Maddy