Details
-
Task
-
Resolution: Done
-
Minor - P4
-
None
-
None
-
None
-
test environment:
1)win7 x64 enterprise version(debug server)
eclipse(with plugin com.sysdeo.eclipse.tomcat_3.3.0) + apache-tomcat-7.0.19
2)ubunto linux 12.04 x64 server (test server)
apache-tomcat-7.0.19
3)ubunto linux 12.04 x64 server (mongo replica set server * 3)
mongo db ver 2.2
the following command is called after replica set is build (without keyfile)
use image_db
db.addUser('testusr','testpwd')
db.createCollection('image_collection',{autoIndexId:true})
db.image_db.ensureIndex({'name':1, 'userid':1, 'kind':1},{backgroud:true})
test environment: 1)win7 x64 enterprise version(debug server) eclipse(with plugin com.sysdeo.eclipse.tomcat_3.3.0) + apache-tomcat-7.0.19 2)ubunto linux 12.04 x64 server (test server) apache-tomcat-7.0.19 3)ubunto linux 12.04 x64 server (mongo replica set server * 3) mongo db ver 2.2 the following command is called after replica set is build (without keyfile) use image_db db.addUser('testusr','testpwd') db.createCollection('image_collection',{autoIndexId:true}) db.image_db.ensureIndex({'name':1, 'userid':1, 'kind':1},{backgroud:true})
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?