Skip to content
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

Transaction RollBack Option #1219

Open
JapaharJose opened this issue Jun 12, 2023 · 4 comments
Open

Transaction RollBack Option #1219

JapaharJose opened this issue Jun 12, 2023 · 4 comments

Comments

@JapaharJose
Copy link

JapaharJose commented Jun 12, 2023

Is there any option to rollback the emitted transaction(db update) when there is any error occurred in the process.

@intech
Copy link
Member

intech commented Jun 13, 2023

@JapaharJose, could you kindly specify the package you are utilizing - moleculer-db or database - and mention the database adapter you are using? Thank you.

@JapaharJose
Copy link
Author

JapaharJose commented Jun 13, 2023

@intech We are using mongodb and mongoose adapter.

@JapaharJose
Copy link
Author

Can anyone answer this?

@ccampanale
Copy link

@JapaharJose AFAIK neither moleculer nor moleculer-db provide support for any sort of transactional awareness that would handle this sort of rollback.

The Moleculer framework itself focuses primarily on the composition and control of microservices for which there is no standard/inherent transactional practice/pattern. I highly recommend reviewing the patterns documented for both data management and transactional messages in microservice systems over on https://microservices.io/.

The Moleculer DB package which provides some standard, supported database adapters targeting various database management systems for Moleculer services also, as far as I know, is relatively unopinionated about the approach and utilization.

How your application handles transactions - for both data management and inter-service messaging - is something your application will need to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants