Hi to all.
I already asked to Massimo if there is a way to control by DAL methods
if a db connection went down and restart it: Seems that DAL should try
to re-establish the connection automatically.
I am developing a desktop python app. with a gluon.shell fake
environment and any query is made within the same request object (it
is not reset)
db transactions are executed normally with a postgres connection for
some minutes and after that, this error is raised on each db object
query command:
Traceback (most recent call last):
File "/home/alan/gestionlibre_gui-hg/gui.py", line 215, in
OnLinkClicked
xml = action(link.Href)
File "/home/alan/gestionlibre_gui-hg/gui.py", line 397, in action
xml = gluon.template.render(filename=absolute_path,
path=config.TEMPLATES_FOLDER, context = action_data)
File "/home/alan/web2py-hg/gluon/template.py", line 916, in render
exec(code) in context
File "<string>", line 78, in <module>
File "/home/alan/web2py-hg/gluon/dal.py", line 6330, in select
return self.db._adapter.select(self.query,fields,attributes)
File "/home/alan/web2py-hg/gluon/dal.py", line 1282, in select
rows = response(sql)
File "/home/alan/web2py-hg/gluon/dal.py", line 1272, in response
self.execute(sql)
File "/home/alan/web2py-hg/gluon/dal.py", line 1359, in execute
return self.log_execute(*a, **b)
File "/home/alan/web2py-hg/gluon/dal.py", line 1353, in log_execute
ret = self.cursor.execute(*a, **b)
psycopg2.OperationalError: el servidor ha cerrado la conexión
inesperadamente
Probablemente se debe a que el servidor terminó de manera
anormal
antes o durante el procesamiento de la petición.
How can I catch this connection issues to keep the application
database interface available? Is it a database engine/desktop app
related problem or is there something in DAL wich is not compatible
outside the web server environment?
Here is my system configuration:
Python 2.6.5
Linux O.S.
PostgreSQL 8.4
web2py 1.99.3
psycopg2 2.0.13