authentication problem on Replica Set

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Environment:
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      *******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?

            Assignee:
            Unassigned
            Reporter:
            zhoumingyi
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: