Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Make connection pool pluggable #245

Closed
robertjpayne opened this issue Dec 15, 2013 · 2 comments
Closed

Make connection pool pluggable #245

robertjpayne opened this issue Dec 15, 2013 · 2 comments

Comments

@robertjpayne
Copy link

Moped (master) recently ripped out it's connecting pooling mechanism and switched to the connection_pool gem.

I particularly am using Mongoid + Moped with TokuMX. It works really great and passes all specs with exception to full text/geospatial indexes which TokuMX does not currently support.

One of the features of TokuMX is multi-statement transactions but this requires a traditional RDMBS sort of communication channel across the same socket.

Before the connection pool change two weeks ago this worked fine as the connections were pinned to the current thread which in most cases would never be doing more than one transaction at a time.

Is there any change we could get this class to be pluggable? I know it's easy enough to monkey patch the entire thing but it'd be great for moped to allow specific implementations of the connection pool potentially.

robertjpayne referenced this issue Dec 15, 2013
We do not need to guarantee thread affinity so the complexity of the
internal connection pool and reaper is no longer needed. We simply now
just use the connection_pool gem.
@robertjpayne
Copy link
Author

Gah I apologise, after more testing it appears the bug I'm after trying to fix because of this change only occurs in Rspec tests which is a bit unfortunately.

The connection_pool gem already seems to properly make the connections exhibit thread affinity behaviour

@nofxx
Copy link

nofxx commented Dec 6, 2014

Was writing this in mongoid when I've realized it's moped issue:
Recently found out about this MongoDB distro:

http://www.tokutek.com/tokumx-for-mongodb/
http://docs.tokutek.com/tokumx/
https://github.com/Tokutek/mongo

Which, just for a use case, looks exactly what my app needs now: transactions and less disk/ram usage.

I'm still trying to understand it better, but the only difference (from mongoid perspective) is transactions.
Guess this might be a better fit as an external gem, if monkey patching can be avoided.
http://docs.tokutek.com/tokumx/tokumx-transactions.html#tokumx-transactions-multi-statement-drivers

@robertjpayne mind sharing how you did transactions?

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

No branches or pull requests

2 participants