[JAVA-2952] Start session failed Created: 30/Aug/18 Updated: 27/Oct/23 Resolved: 31/Aug/18 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Session Management |
| Affects Version/s: | 3.8.1 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Jie | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | driver | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
windows |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
I have a mongodb server 4.0.1, start with below script. It's a single server.
When create session in Java, it failed.
|
| Comments |
| Comment by Jeffrey Yemin [ 31/Aug/18 ] |
|
Linked to |
| Comment by Jeffrey Yemin [ 31/Aug/18 ] |
|
ClientSession#startSession is not the same as the startSession command. It applies different rules for whether a session is allowed. See the sessions spec for the details. |
| Comment by Jie [ 31/Aug/18 ] |
|
Jeff, Thanks for your reply. I saw the documentation. but I can start session with Robo3T shell. command: db.runCommand( { startSession: 1 } ) output: { ,
BTW, the site prompt error "JIRA could not attach the file as there was a missing token", when I tried to update a screenshot picture. |
| Comment by Jeffrey Yemin [ 30/Aug/18 ] |
|
Please create a replica set and try again, as startSession doesn't work with a standalone mongod server. See https://docs.mongodb.com/manual/reference/server-sessions/#overview for details. This should be included in the Javadoc though, so I may re-purpose this ticket as a request for better documentation. |
| Comment by Jie [ 30/Aug/18 ] |
|
I tried startSession with shell. It's ok. Obviously, it's a driver issue. |