plajjan/NIPAP — Issue #134: Handle lost database connection
Author: garberg
Created: 2011-11-04 15:35:23+00:00
State: open

If the database connection is lost, nipapd displays something like this (even if postgres has been started again):

```
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 133, in maybeDeferred
result = f(*args, **kw)
File "/home/garberg/jobb/t2/nipap/nipap/nipap/xmlrpc.py", line 203, in xmlrpc_list_schema
return self.nipap.list_schema(args.get('auth'), args.get('schema'))
File "/home/garberg/jobb/t2/nipap/nipap/nipap/nipap.py", line 663, in list_schema
for row in self._curs_pg:
File "/home/garberg/jobb/t2/nipap/nipap/nipap/nipap.py", line 383, in _execute
self._con_pg.rollback()
psycopg2.InterfaceError: connection already closed
```
The client receives a generic error which does not state any cause of the error.

At least we should try to reconnect :)