Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Lost DB connection when I use Pony for connect to the remote Postgres database. #219
File "... / lib / python2.7 / site-packages / pony / orm / core.py", line 1566, in close
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?
I think that your problem caused by the following sequense of actions:
I think we need to improve handling of rollback so it does not mask previous exception in case the connection is closed already.
Regarding your situation, I think the right way is not to attempt to reconnect, but to prevent an exception which lead to connection closing. After we fix handling of rollback, you should be able to see this original exception and will be able to fix its root
Thanks for reporting, I fixed it. Previously the "connection already closed" exception masked the original exception which causes the connection closing. Now you can see the reason for connection closing, and if it is caused by some bug in Pony you can open another issue related to that specific problem.