-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
Introduce transaction hooks in @tsed/mikro-orm #2370
Labels
Comments
derevnjuk
added a commit
to derevnjuk/tsed
that referenced
this issue
Jul 10, 2023
derevnjuk
added a commit
to derevnjuk/tsed
that referenced
this issue
Jul 11, 2023
Once #2293 is merged, this request will be addressed as well. |
derevnjuk
added a commit
to derevnjuk/tsed
that referenced
this issue
Jul 11, 2023
4 tasks
derevnjuk
added a commit
to derevnjuk/tsed
that referenced
this issue
Jul 11, 2023
derevnjuk
added a commit
to derevnjuk/tsed
that referenced
this issue
Jul 11, 2023
derevnjuk
added a commit
to derevnjuk/tsed
that referenced
this issue
Jul 13, 2023
derevnjuk
added a commit
that referenced
this issue
Jul 20, 2023
🎉 This issue has been resolved in version 7.34.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Information
The current version of
@tsed/mikro-orm
lacks a comprehensive set of transaction hooks that allow developers to customize transaction behavior. To address this limitation, I propose the addition of two new interfaces,BeforeTransactionCommit
andAfterTransactionCommit
, which provide the ability to define hooks executed right before and after committing data to the database.Example
Use Case
The proposed transaction hooks would empower developers to implement advanced patterns such as the Inbox pattern or domain event dispatch. With
BeforeTransactionCommit
, developers can modify data within the same transaction context, allowing them to perform additional operations before the transaction is committed. Conversely,AfterTransactionCommit
enables executing code after the data is committed, making it suitable for handling eventual consistency and compensatory actions in case of failures.Acceptance criteria
$beforeTransactionCommit
event should be fired within the same transaction context before the data is committed to the database.$afterTransactionCommit
method should be fired after the data is successfully committed to the database.The text was updated successfully, but these errors were encountered: