-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add MongoDB functions to handle transactions #96
feat: add MongoDB functions to handle transactions #96
Conversation
Signed-off-by: Patricia Reinoso <[email protected]>
Signed-off-by: Patricia Reinoso <[email protected]>
HI @patriciareinoso - Where you plan to use the transaction feature? |
Hi @thakurajayL omec-project/webconsole#279 We are trying to ensure consistency in the DB after a DELETE operation. In the PR we would like to DELETE the reference to the gNB or UPF in a Network Slice after they are deleted. The idea is to do this also when deleting a Subscriber (-> remove the reference in the "imsis" list of Device Groups) and deleting Device Groups (-> remove the reference in the "site-device-group" list of Network Slices) |
* add MongoDB functions to handle transactions Signed-off-by: Patricia Reinoso <[email protected]> * rename to supports transactions Signed-off-by: Patricia Reinoso <[email protected]> --------- Signed-off-by: Patricia Reinoso <[email protected]> Signed-off-by: Ajay Lotan Thakur <[email protected]>
* Updates in the logs Signed-off-by: Ajay Lotan Thakur <[email protected]> * Bump github.com/gin-contrib/cors in /mongoapi/dbtestapp (#94) Signed-off-by: Ajay Lotan Thakur <[email protected]> * Fixing API errors Signed-off-by: Ajay Lotan Thakur <[email protected]> * Update drsm/api.go Co-authored-by: gab-arrobo <[email protected]> Signed-off-by: Ajay Lotan Thakur <[email protected]> * Update drsm/api.go Co-authored-by: gab-arrobo <[email protected]> Signed-off-by: Ajay Lotan Thakur <[email protected]> * Update drsm/api.go Co-authored-by: gab-arrobo <[email protected]> Signed-off-by: Ajay Lotan Thakur <[email protected]> * Update drsm/chunk.go Co-authored-by: gab-arrobo <[email protected]> Signed-off-by: Ajay Lotan Thakur <[email protected]> * Update drsm/claim.go Co-authored-by: gab-arrobo <[email protected]> Signed-off-by: Ajay Lotan Thakur <[email protected]> * Fix typo and update logging level Signed-off-by: Ajay Lotan Thakur <[email protected]> * feat: add MongoDB functions to handle transactions (#96) * add MongoDB functions to handle transactions Signed-off-by: Patricia Reinoso <[email protected]> * rename to supports transactions Signed-off-by: Patricia Reinoso <[email protected]> --------- Signed-off-by: Patricia Reinoso <[email protected]> Signed-off-by: Ajay Lotan Thakur <[email protected]> * Update drsm/api.go Co-authored-by: gab-arrobo <[email protected]> Signed-off-by: Ajay Lotan Thakur <[email protected]> --------- Signed-off-by: Ajay Lotan Thakur <[email protected]>
This PR adds 4 functions needed to handle transactions in mongoDB.
We would like to use transactions to ensure Atomicity in operations that perform 2 or more actions over the DB. With transactions, the operations are rolled back in case of failure. https://www.mongodb.com/docs/manual/core/transactions/
Transactions can only be used in Replica Set or sharded deployments.
Operations in a transaction use a shared
mongo.SessionContext
instead of separatecontext.TODO()