Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error from repeated calls to connect/ disconnect #112

Open
edward-burn opened this issue Dec 21, 2021 · 1 comment
Open

Error from repeated calls to connect/ disconnect #112

edward-burn opened this issue Dec 21, 2021 · 1 comment
Labels
enhancement New functionality that could be added help wanted Will probably not be addressed by the package maintainer, but could be addressed by someone else

Comments

@edward-burn
Copy link

In trying to run this study from @Xintong-Li-ZnCu the repeated calls to connect and disconnect to the database here

connection <- DatabaseConnector::connect(connectionDetails)

causes problems running on sidiap´s postgres database (at some point we get an error with a connect call failing). I have seen this before when working with the database myself, but avoided it by leaving the connection to the database open throughout an analysis.

My current way of getting past this for the current project has been to add the option to open the connection to the database at the start of the CodeToRun for the study package, by adding an additional argument to the function here and making this an if statement so it only connects/ disconnect if the connection is not already open and specified.

I am not sure whether you would actually want this functionality in CohortMethod (I will try and work with our database manager to see if this is just being caused by a security setting with our database that can be changed), but for awareness I thought I´d raise this as a possible issue.

@schuemie schuemie added enhancement New functionality that could be added help wanted Will probably not be addressed by the package maintainer, but could be addressed by someone else labels Jun 3, 2022
@schuemie
Copy link
Member

schuemie commented Jun 3, 2022

Other HADES packages do allow you to provide either connectionDetails or a connection (see for example CohortDiagnostics). It would make sense to add it here as well, but a challenge is that the data fetching is often done in separate threads, and you can't share connections between threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New functionality that could be added help wanted Will probably not be addressed by the package maintainer, but could be addressed by someone else
Projects
None yet
Development

No branches or pull requests

2 participants