OHDSI Home | Forums | Wiki | Github

DatabaseConnector: Query around support for DB Reconnect

Hi

I am running Achilles against a postgresql database, and as such, am using DatabaseConnector to connect to the database.

During the execution of the SQL queries, I will regularly see an error executing SQL, leading to a closed connection.

Once the connection is closed, I am seeing that the DatabaseConnector does not reconnect, and all subsequent queries will fail.

[Main Analysis] [COMPLETE] 425 (4.586913 secs)
Analysis 424 (Number of co-occurring condition_occurrence condition_concept_id pairs) -- START
Analysis 424 -- ERROR Error: Error executing SQL:
org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
An error report has been created at  /opt/app/errorReport.txt

  |=======================                                               |  33%Analysis 500 (Number of persons with death, by cause_concept_id) -- START
Analysis 500 -- ERROR Error: Error executing SQL:
org.postgresql.util.PSQLException: This connection has been closed.
An error report has been created at  /opt/app/errorReport.txt

  |                                                                      |   0%Analysis 501 (Number of records of death, by cause_concept_id) -- START
Analysis 501 -- ERROR Error: Error executing SQL:
org.postgresql.util.PSQLException: This connection has been closed.
An error report has been created at  /opt/app/errorReport.txt

  |                                                                      |   0%Analysis 502 (Number of persons by death month) -- START
Analysis 502 -- ERROR Error: Error executing SQL:
org.postgresql.util.PSQLException: This connection has been closed.
An error report has been created at  /opt/app/errorReport.txt

  |                                                                      |   0%Analysis 504 (Number of persons with a death, by calendar year by gender by age decile) -- START
  |                                                                      |   0%Analysis 505 (Number of death records, by death_type_concept_id) -- START
Analysis 504 -- ERROR Error: Error executing SQL:
org.postgresql.util.PSQLException: This connection has been closed.
An error report has been created at  /opt/app/errorReport.txt

Does DatabaseConnector support an auto-reconnect if the connection drops?

Currently, DatabaseConnector does not support auto-reconnect. I’m also not sure it should. If a statement fails, then just going ahead with subsequent statements may lead to inconsistencies.

Perhaps it is better to focus on the original errors themselves? Any idea why there is the I/O error? (Some googling suggests network connectivity issues, but the server logs should help clarify what is going on).

t