Fix incorrect handling of transactions using deferred constraints #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
doctrine#6543 partially solved what we tried to achieve in doctrine#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.The current faulty flow is following:
commit()
, Unique violation occursrollback()
There's no active transaction
exception is thrown:This PR adjusts the flow so:
commit()
, Unique violation occursrollback()
🥳