Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (4k points)

I am using Java driver to access mongodb. I assume the db connection pooling is internally handled by the driver.But my connection count getting increased every time I access db.

This is my serverStatus log.

"connections" : {
            "current" : 276,
            "available" : 543
    }

Do I need to explicitly close mongo connections? how should I manage connection pooling in java?

1 Answer

0 votes
by (8.7k points)

For pooling you Should use a single MongoDB object otherwise for using multiple objects you have to call explicitly the close() command for each object.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Feb 12, 2020 in Web Technology by ashely (50.2k points)
0 votes
2 answers
+1 vote
1 answer

Browse Categories

...