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

authentication problem on Replica Set

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • None

    Description

      *******NOTE start*******
      As i can't confirm that this is a driver problem
      or tomcat problem
      or just a misuse of driver.
      Please just help me confirm that whether driver problem.

                    • NOTE end ********

      attached code runs normally when access a single mongo server(NOT a replica set )
      but when i try to access replica set server, it pop a exception:(40 thread test)
      java.lang.IllegalStateException: can't authenticate twice on the same database

      i don't know why [m_DBAccess.isAuthenticated()]returns a false and [m_DBAccess.authenticate] pop this exception.
      please help.

      PS:
      This only appearred in win 7 server(env 1), it does not appearred in linux server(env 2)

      code backgroud
      m_MongoDB is a static Mongo instance.
      m_DBAccess is a DB instance that every thread will get a db instance by using [m_MongoDB.getDB("db_image")]
      In my opinion, every thread has a different db object (although it point to the same db), so authentication of each thread is needed.
      Am i right?

      Attachments

        Activity

          People

            Unassigned Unassigned
            enchor zhoumingyi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: