[JAVA-5132] Can I only implement transactions by passing in a ClientSession Created: 01/Sep/23  Updated: 05/Sep/23  Resolved: 05/Sep/23

Status: Closed
Project: Java Driver
Component/s: Transaction Management
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Unknown
Reporter: chaoyang jia Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

Excuse me, can I only implement transactions by passing in a ClientSession during CRUD? In this way, I won't be able to customize the operations. For example, if I want to use annotation control, is there a way for me to control it myself? For example, if I pass a ClientSession to MongoClient, I pass it, but it's still not available and cannot be rolled back



 Comments   
Comment by Ross Lawley [ 05/Sep/23 ]

Hi j15030047216@163.com,

That's correct to use transactions the associated client session must be passed to all operations within that transaction.

Just to let you know for future reference here are some resources to get questions like this answered more quickly:

  • If you are a customer our MongoDB support portal, located at support.mongodb.com
  • Our MongoDB community portal, located here
  • If you are an Atlas customer, there is free support offered 24/7 in the lower right hand corner of the UI

All the best,

Ross Lawley

Comment by PM Bot [ 01/Sep/23 ]

Hi j15030047216@163.com, thank you for reporting this issue! The team will look into it and get back to you soon.

Generated at Thu Feb 08 09:03:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.