如何将mongodb与casbah连接起来? [英] How to pool the connections of mongodb with casbah?

查看:145
本文介绍了如何将mongodb与casbah连接起来?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将mongodb与Scala驱动程序casbah一起使用.如果我不理解错误,则不提供连接池.是否有用于casbah的池库,例如用于jdbc连接的dbcp/c3p0?

I'm using mongodb with scala driver casbah. If I'm not understanding wrong, it doesn't provide connection pool. Is there any pool libraries for casbah, like dbcp/c3p0 for jdbc connections?

推荐答案

Casbah包装了提供连接池的MongoDB Java驱动程序. MongoConnection的实例实际上是池的实例,而不是单个连接.可以使用传递给新的MongoConnection的MongoOptions类的实例来调整池.

Casbah wraps the MongoDB Java Driver which provides a connection pool. An Instance of MongoConnection is actually an instance of the pool, not an individual connection. The pool can be tuned with an instance of the MongoOptions class passed to a new MongoConnection.

这篇关于如何将mongodb与casbah连接起来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆