Skip to content

Lost DB connection when I use Pony for connect to the remote Postgres database.  #219

@vmcfire

Description

@vmcfire

Vasiliy Makaganchuk:
Hello everybody. I use Pony for connect to the remote Postgres database. Periodically, the database connection is lost and Pony returns an exception:

File "... / lib / python2.7 / site-packages / pony / orm / core.py", line 1566, in close
try: provider.rollback (connection, cache)
File "<auto generated wrapper of rollback () function>", line 2, in rollback
File "... / lib / python2.7 / site-packages / pony / orm / dbapiprovider.py", line 59, in wrap_dbapi_exceptions
raise InterfaceError (e)
RollbackException: InterfaceError: connection already closed

After that, Pony automatic reconnect, but my function call is aborted.

Is it possible to test the connection and forced to reconnect? I have not found the necessary methods in Pony docs. Maybe you need to look at psycopg2 docs?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions