[GODRIVER-1104] Provide imperative transaction API Created: 03/Jun/19 Updated: 28/Oct/23 Resolved: 13/Apr/20 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | CRUD |
| Affects Version/s: | None |
| Fix Version/s: | 1.4.0 |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Ammar Bandukwala | Assignee: | Divjot Arora (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
This issue follows from the GitHub discussion here: https://github.com/mongodb/mongo-go-driver/pull/161. Basically, I believe that we should provide a transaction API similar to `database/sql` for these reasons:
|
| Comments |
| Comment by Githook User [ 13/Apr/20 ] |
|
Author: {'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}Message: |
| Comment by Divjot Arora (Inactive) [ 10/Apr/20 ] |
| Comment by Divjot Arora (Inactive) [ 03/Feb/20 ] |
|
Putting this back into "Needs Triage" because we've discussed this internally and think that this may be a good idea to have, as a callback-based API isn't always a usable solution for applications. |
| Comment by Kristofer Brandow (Inactive) [ 10/Jun/19 ] |
|
Hi ammarb, Thanks for filing this ticket. We understand that being forced to use a closure or callback to use the MongoDB Sessions API isn't ideal. We try to build flexible APIs but in this circumstance there is a high chance of misuse and that misuse is difficult to detect. This can result in a user thinking they've protected themselves by using a transaction or session and not find out they didn't until something catastrophic happens. In other words, adding this API makes it too easy for users to use the API in a manner that defeats the main benefits of the API. In the future we will be redesigning the API of all the drivers to fix issues like this with sessions, so instead of adding this API now we will wait until that redesign happens. Thanks, Kris |