Ticket #5063: reconnect.diff
File reconnect.diff, 778 bytes (added by , 17 years ago) |
---|
-
django/db/backends/postgresql_psycopg2/base.py
31 31 def cursor(self): 32 32 from django.conf import settings 33 33 set_tz = False 34 35 # psycopg2 closes the DB connection when OperationalError is thrown 36 # We can test for this by examining connection.closed 37 # If true we must re-establish the connection. 38 if self.connection and self.connection.closed: 39 self.connection = None 40 34 41 if self.connection is None: 35 42 set_tz = True 36 43 if settings.DATABASE_NAME == '':