-
Notifications
You must be signed in to change notification settings - Fork 11.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
TransactionCommitted event doesn’t contain transaction level I’d expect it to #30756
Comments
Hmm I can indeed see that as problematic. Appreciating a PR if you could whip up one. Thanks for reporting. |
@driesvints Thanks for confirming! Will work on a PR 🙂 What branch should I open the PR against? |
Probably master |
Please read https://laravel.com/docs/6.x/contributions |
@AReyes-cl Was that really necessary? @driesvints already gave an answer. A week ago. I wasn’t sure whether this was a bug fix or a “major new feature”, which is why I asked. |
@martinbean I think it makes sense that |
@martinbean according to the docs https://laravel.com/docs/6.x/contributions#which-branch:
|
@denvit an answer was already provided for this and someone already noted this above. I'm going to lock this as I believe there isn't really anything left to discuss here. Anyone's free to pr in a fix for this. |
PR was merged. |
Description:
When the
TransactionCommitted
event is dispatched, it seems to contain the transaction level after the transaction has been committed, rather than the transaction level the connection was at when the transaction was committed.For example, if I begin a transaction, that dispatches a
TransactionBeginning
event and the transaction level on the connection is incremented to1
. When that transaction is committed, aTransactionCommitted
event is dispatched but the transaction level is0
. I’d expect the transaction level for the correspondingTransactionCommitted
event to be1
as well, so I can listen for when a transaction is started and committed.Steps To Reproduce:
TransactionBeginning
event is1
.TransactionCommitted
event is0
(one less than transaction level inTransactionBeginning
event).Test Code
I created a simple route that writes a row within a transaction, and set up listeners on the
TransactionBeginning
andTransactionCommitted
events to log the transaction level:Contents of log file after hitting route:
The text was updated successfully, but these errors were encountered: