-
Notifications
You must be signed in to change notification settings - Fork 156
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
Remember the pool options for a given connection. #175
Comments
This is a limitation of the I have been toying with the idea of providing our own behaviour for |
How about using a global configuration? Application could configure:
In https://github.com/ankhers/mongodb/blob/master/lib/mongo.ex
& in https://github.com/ankhers/mongodb/blob/master/lib/mongo.ex#L887
|
I do not think that would be the best option. A number of people I have spoken with use multiple mongo connections in their application(s) (think multi tenant). I am unsure if they are actually using the same pool type for every connection. I will try to speak to the db_connection team about this. |
I dont see a conflict unless I am missing something about db_connection. If different databases are used each of them needs a dedicated pool. The In my proposal, if the application (for any reason) wants different pulling options for different database, the application could still define the default pooling module in the configuration file and defines the specific pool module for the exception specific case. And again if the application always defines the pool option as the case currently it would still work the same. |
I also think that specifying a pool per connection is better, but in cases that are necessary could be an option on the query to execute it on another pool. For example if I start a mongo connection I'll try to look into it this weekend |
I looked at the codebase, here are my findings: We need somehow get the |
Hey all, I'm not sure how useful this is, but I found a workaround for this. Check out this Gist. It's not self-sufficient to copy/paste into your project, but it should give you an idea of how to go about doing it. |
To use pooling the current usage is:
Having to repeat
pool: DBConnection.Poolboy
at query time should not be necessary.The text was updated successfully, but these errors were encountered: