connection

Making sure that psycopg2 database connection alive

Making sure that psycopg2 database connection alive Question: I have a python application that opens a database connection that can hang online for an hours, but sometimes the database server reboots and while python still have the connection it won’t work with OperationalError exception. So I’m looking for any reliable method to “ping” the database …

Total answers: 4