I am using the package pool for a Shiny-app, which establishes a connection to my PostgreSQL-DB. From time to time i am getting the error-msg below without the app running. Also when I run the code locally, the same error appears, and sometimes repeatedly.
Warning in postgresqlQuickSQL(conn, statement, ...) : Could not create execute: SELECT 1 Error in postgresqlExecStatement(conn, statement, ...) : RS-DBI driver: (could not run statement: no connection to the server )
Is it because pool creates a connection to the DB and after some time the DB (or server) gets disconnected because of a time-out?
Anyway, nowhere in my code I am making an SQL-query which has SELECT 1 inside.
- Is the query coming from pool itself (The
validateQuery())? - How can I prevent this error?
In my ShinyApp I have also the following code to end the pool connection after the App was closed:
session$onSessionEnded(function() {
pool::poolClose(pool)
})
Furthermore, when running the ShinyApp, the App works fine & behaves as expected. But when I close the App, RStudio often crashes and I have to reopen it and reload the Project.
- Why is that?
- How can I find out what caused the crash?