-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix incorrect transactional()
handling when DB auto-rolled back the transaction
#6545
Conversation
It seems there are CI jobs failing. Please take a look at this guide for more on how to handle those. |
Thanks, just did not notice that basic stuff, u were faster 🙃 fixed. |
71e5b43
to
9879edf
Compare
ebc4aa1
to
b512770
Compare
675d1ac
to
e9ea2b1
Compare
transactional()
handling when DB auto-rolled back the transaction
…6563) | Q | A |------------- | ----------- | Type | improvement | Fixed issues | <!-- use #NUM format to reference an issue --> #### Summary Covers the concern expressed by @greg0ire #6545 (comment) This ensures the transaction is (not)active based on `autocommmit` mode when interacting with `transactional()`.
… transaction Let's get rid of There's no active transaction exception which occurs e.g. when using deferred constraints so the violation is checked at the end of the transaction and not during it. - Do not rollback only on exceptions where we know the transaction is no longer active - Introduce TransactionRolledBack exception - Transform Oracle's "transaction rolled back" exception and use the underlying one that DBAL supports
It will take me some time to understand the details in order to provide a meaningful feedback. Please feel free to merge it as is. The number of "line not covered by tests" warnings and enumeration of specific exception classes in handling a commit failure is a bit concerning, though. On the positive side, the fix doesn't introduce any new API, so if something goes seriously wrong, it will be safe to revert. |
I think that for some reason, codecov only processes the reports from appveyor, and not from github-action. I have yet to figure out why. |
Thanks @simPod 🎉 |
Let me know if you need help resolving v4 conflicts. |
Thanks for offering your help, I do need it 🙏 |
Summary
#6543 partially solved what we tried to achieve in #4846. With that
There's no active transaction
exception contains the actual exception in$previous
.Now, let's get rid of
There's no active transaction
exception which occurs e.g. when using deferred constraints so the violation is checked at the end of the transaction and not during it. Database then rolls back the transaction automatically.The current faulty flow is following:
commit()
, Constrain violation occursrollback()
There's no active transaction
exception is thrown:This PR adjusts the flow so:
commit()
, Constrain violation occursrollback()
🥳For DBAL v4 it looks like this #6546 (draft, does not contain review changes)