Reputation: 415
I'm positive I'm getting al this wrong, but here's my question:
I need a connection pool to mongo which I create like so:
mongo::ScopedDbConnection connectionPool("localhost");
Then on each thread, I do:
mongo::DBClientConnection c(connectionPool.get()); <-- is this even right?
Next I need to run
c.runCommand()
and give the connection back:
connectionPool.done();
Am I doing this correctly?
Thanks all for your help!
Upvotes: 2
Views: 449
Reputation: 415
I got it works like this:
mongo::ScopedDbConnection* c;
c = mongo::ScopedDbConnection::getScopedDbConnection("127.0.0.1");
if( c->ok() )
{
c->get()->runCommand( "tracer", query_upsert_document, objError );
c->done();
}
Thanks all for your help!
Regards,
Upvotes: 1