Use a single MongoClient across a JavaEE web service
问题 After reading the mongo documentation that says each instance of a MongoClient handles its own pooling, how would I go about only having one instance across my whole application? This seems like it could be a scenario for using a singleton bean, but this seems like it would defeat the purpose of connection pooling. If only one user would be able to access the bean that contains the MongoClient instance at a time, surely multiple connections in the pool would never be used at the same time.