Comments (16)
that makes sense, I think I started getting it when I updated RStudio!
from databaseconnector.
Hi @alondhe . I haven't seen this error message before. Does it also occur outside of SCCS?
from databaseconnector.
I'm getting the same thing with PLP
from databaseconnector.
Hmmm, I'm not able to reproduce this error. What versions of DatabaseConnector and RStudio are you running?
from databaseconnector.
This might not be it (since @alondhe says that it's intermittent) but is it possible that there's a try-with-resources
block surrounding some code that would cause the open connection to be closed after leaving the try{} block? Described here: https://stackoverflow.com/questions/42494178/java-sql-sqlexception-database-connection-closed
Edit: nevermind, that would only happen if you were writing java code with try{}...this is happening at the R-wrapper level. Sorry for the noise.
from databaseconnector.
Hi @chrisknoll , what my guess is, is that RStudio doesn't know the connection is closed. In the newer versions of RStudio there's a Connections
tab that shows open connections, and disconnect
lets RStudio know when a connection closes.
Maybe the connection is closed from the server side?
from databaseconnector.
It sounds like you're saying that the error isn't from the PLP/SCCS package at all, rather it's RStudio noticing a connection and then trying to get some meta on it?
from databaseconnector.
Yes, that is my guess. But I'm not sure why I'm not seeing it.
from databaseconnector.
Agreed @jreps. I'm running on version 1.1.383, which is right around the time the Connections panel was added. This panel refreshes connection metadata often, to coincide with active SQL connections. Must be a bug with it. There is a newer version, 1.1.453, I'll try to replicate with it.
from databaseconnector.
Apparently, you can use this to prevent the Connections tab from loading:
options(connectionObserver = NULL)
Is this something we'd want DatabaseConnector::connect to set, or just document?
from databaseconnector.
Good times....I need to re-install all my tools since I got this new lappy....should be fun working through all the new issues!
Thanks for the tip on turning that off, @alondhe .
from databaseconnector.
Noooo! I didn't spend all this time on setting up communication between DatabaseConnector and RStudio for people to just turn it off at the first sign of trouble.
I am now able to reproduce the error: It happens when you open multiple connections to the same server in the same R session. Then, if you close one, it somehow confuses which one gets closed. @alondhe , @jreps : would you be able to tell me whether you still had connections open before you kicked off PLP or SCCS?
In general it is best practice to close connections once you are done with them. If you do that, I'm pretty sure the problem does not occur. In the mean time I'll try to figure out a solution.
from databaseconnector.
I just committed a fix that allows you to have multiple connections to the same server open at once. Please use devtools::install_github("ohdsi/DatabaseConnector")
to install it and let me know if this solves the problem.
In the mean time, keep an eye on the connections tab, and ask yourself whether you really need to have all those connections open ;-)
from databaseconnector.
In the mean time, keep an eye on the connections tab, and ask yourself whether you really need to have all those connections open ;-)
Always good advice, but on the topic of resource leaks, I am not sure that when PLE executes, everything is closed up completely...sometimes when I finish an 'execute()' and i want to delete results for a re-run, there is a file lock somewhere that I need to restart R to clear. I think the same thing might be happening with db connections where connections that are created during the process aren't closed afterwards (or possibly left open when an error occurs, so maybe some cleanup on error is needed).
Of course I don't have concrete data to back this up, but just pointing out something that might want to be looked for.
from databaseconnector.
@chrisknoll : for that reason I've started putting the disconnect
call in an on.exit
clause, like here. That way, the connection is also closed when the function is terminated prematurely due to an error or uses action.
ff has its own weird logic of when to give up file locks that has eluded me so far. But definitely something to look at as well.
from databaseconnector.
ff has its own weird logic of when to give up file locks that has eluded me so far. But definitely something to look at as well.
Now that you mention that, I believe it was those .ff files that was preventing me from deleting.
from databaseconnector.
Related Issues (20)
- getTableNames does not seem to work on BigQuery HOT 8
- Create Fatal Error when load package in RStudio 2022.02.2 HOT 5
- Add option to log execution of each individual SQL statement HOT 1
- DBI refactoring HOT 26
- Erroneous dates when inserting a tibble into SQLite HOT 2
- Issue with DBMS/jdbcDriver HOT 2
- Support new Andromeda arrow backend
- WARNING: An illegal reflective access operation has occurred HOT 1
- Error message observed while uploading json to postgres from phenotype library HOT 1
- Installation of `DatabaseConnector` on ๐ฉ๐จ๐ณ๐น็บขๆไธญ็ง RedFlag Linux (๐ฅDebian 11) HOT 1
- Snowflake dialect support HOT 2
- Azure Synapse Analytics Dedicated dialect support
- Error in uploading vocabularies csv files in BigQuery HOT 15
- Add function for fast computation of a hash of the content of a database schema HOT 1
- 5.1.0 breaks backwards compatibility on sql server - deviates from typical drop table HOT 3
- Download drivers `method` argument
- DLL Authentication Not Working HOT 2
- Support for External Tables in getTableNames HOT 6
- Update Spark drivers to work with Databricks HOT 34
- Ability to upload and download a dataframe from a database such that the dataframe remains unchanged (DBI 'roundtrip' test) HOT 21
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from databaseconnector.