Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-760

Document that MongoClient doesn't throw an exception on connection failure

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • 2.10.1
    • Documentation
    • None

    Description

      When creating a new MongoClient instance with valid host/port parameters, but no MongoDB running there, I would expect a MongoException to be thrown. This is not the case. I can even use the MongoClient instance to get a DB instance via getDB() and subsequently a collection instance via getCollection(), again without being actually connected and any exception. I also tried getConnector().isOpen() to verify whether the connection was established and it returned true, without a running server. The latter issue might be me misinterpreting the API though.

      Others (see user "litiales") are observing this as well.

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            brevilo Oliver Bock
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: