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

How can we close a database connection after we create it? #310

Open
houshengbo opened this issue Sep 26, 2016 · 1 comment
Open

How can we close a database connection after we create it? #310

houshengbo opened this issue Sep 26, 2016 · 1 comment

Comments

@houshengbo
Copy link

I have maintain multiple connection to couchdb in one of my projects.

However, after I create the connections with
var db = new(cradle.Connection)().database('starwars');

how can I close the database connection???

@mike-lang
Copy link

To the best of my knowledge the Connection object doesn't represent a any sort of persistent connection, it's mostly a bundle of configuration information used to make HTTP requests to service specific commands, so you generally wouldn't "close" it. If you need to forcibly close the sockets that are currently open and managed by the HttpAgent servicing the cradle "Connection" you should be able to call the close method on the object, but it appears this doesn't apply to longpoll monitoring of the _changes feed. Those sockets appear to be handled by a different HttpAgent than the other requests made by cradle.

Hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants