When you create a
MongoClient instance you create a connection; actually a pool of connections (aka connection pool). By default, the pool has 100 connections (and this depends upon the driver). This is configurable within the Java code. This means, ideally, you should have one Mongo Client instance per JVM.
So, the application’s client uses a connection from the pool and returns it back to the connection pool after its usage. There is no need for closing the connection explicitly. This way the application avoids creating and closing connections (which is an expensive operation).
Of course, you should close the
MongoClient instance, with the
close() method (I had mentioned in my previous reply) at the closing of the application, to clear all the resources.