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

transactional events in subscriber interface #6996

Merged
merged 13 commits into from
Nov 2, 2020
Merged

Conversation

pleerock
Copy link
Member

No description provided.

@pleerock
Copy link
Member Author

pleerock commented Nov 2, 2020

@imnotjames I'm going to merge this one and release a new version. Do you want to review it before I do that?

Copy link
Contributor

@imnotjames imnotjames left a 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.

Comment on lines +62 to +65
/**
* If this is set to true, SELECT query in a `find` method will be executed in a transaction.
*/
transaction?: boolean
Copy link
Contributor

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

Copy link
Member Author

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

@pleerock
Copy link
Member Author

pleerock commented Nov 2, 2020

This does make the disparity between listeners, schema listeners, and subscribers wider, but there's already disparity there as it stands.

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 beforeTransactionStart method.

@pleerock pleerock merged commit 0e4b239 into master Nov 2, 2020
@pleerock pleerock deleted the new-transactional-hooks branch November 2, 2020 15:54
dolsup pushed a commit to dolsup/typeorm that referenced this pull request Nov 3, 2020
…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>
zaro pushed a commit to zaro/typeorm that referenced this pull request Jan 12, 2021
…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>
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

Successfully merging this pull request may close these issues.

None yet

3 participants