-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
transactional events in subscriber interface #6996
Conversation
added test for event listeners; updated docs;
@imnotjames I'm going to merge this one and release a new version. Do you want to review it before I do that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall makes sense.
This does make the disparity between listeners, schema listeners, and subscribers wider, but there's already disparity there as it stands.
/** | ||
* If this is set to true, SELECT query in a `find` method will be executed in a transaction. | ||
*/ | ||
transaction?: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming this was intentionally added but seems to be a separate feature from the rest of this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah I forgot I need to create a separate branch for this separate feature
yes it does, and here is why: when you run: START TRANSACTION
SELECT * FROM user
COMMIT you execute: entity.beforeTransactionStart()
entity.afterTransactionStart() there is no "entity" before SELECT on which we can call |
…tion in FindOptions (typeorm#6996) * added new decorators * added hooks to etnity subscriber interface * added test code in one query runner * removed new decorators and implemented in subscriber instead * added "transaction" option to FindOneOptions * added event listeners in query runners; added test for event listeners; updated docs; * working on test; * working on test; * added test for `transaction` option; * fixing failing test * fixing failing test * fixing typos * fixing test I broke Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
…tion in FindOptions (typeorm#6996) * added new decorators * added hooks to etnity subscriber interface * added test code in one query runner * removed new decorators and implemented in subscriber instead * added "transaction" option to FindOneOptions * added event listeners in query runners; added test for event listeners; updated docs; * working on test; * working on test; * added test for `transaction` option; * fixing failing test * fixing failing test * fixing typos * fixing test I broke Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
No description provided.