It is too complex and expensive to lazy create the connection pool because all methods which uses the pool needs to acquire a lock. So it is easier to create it when the instance is also created. In this case, on closing the database, it should be unregistered from the instances dictionary. issue6202 review32991002