[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? |
| 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 ] |
|
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:
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. |