On Wed, 2011-10-12 at 04:07 -0700, David Marko wrote: > Massimo adviced me to use something like this previsously: > > def make_connection(): > from pymongo import Connection > connection = Connection('localhost', 27017) > return connection > > connection = cache.ram('mongodb',make_connection,None) > > It seemed to work but I had no opportunity to test it under some > load. This is some kind of connection pooling/share
What about using the standard DAL with MongoDBAdapter to manage the connection pool and then use the pymongo.Connection() in db._adapter.connection to directly operate on the database? I haven't tested yet (for now I'm just doing experiments, so I don't need connection pool), but looks like this should work.. -- Samuele ~redShadow~ Santi ---------------------------------------------------------------- redshadow[at]hackzine.org - redshadowhack[at]gmail.com Blog: http://hackzine.org GPG Key signature: 050D 3E9F 6E0B 44CE C008 D1FC 166C 3C7E EB26 4933 ---------------------------------------------------------------- /me recommends: Squadra Informatica - http://www.squadrainformatica.com ---------------------------------------------------------------- - Proud ThinkPad T-Series owner - Registered Linux-User: #440008 * GENTOO User since 1199142000 (2008-01-01) * former DEBIAN SID user ---------------------------------------------------------------- "Software is like sex: it's better when it's free!" -- Linus Torvalds
signature.asc
Description: This is a digitally signed message part