dbal icon indicating copy to clipboard operation
dbal copied to clipboard

Fix incorrect handling of transactions using deferred constraints

Open simPod opened this issue 4 years ago • 25 comments

Closes #3424 as it's very long and outdated so I decided to start again here

Q A
Type bug/feature
BC Break yes
Fixed issues #3423, https://github.com/doctrine/orm/issues/7545

Summary

Rollback is being called when outside of a transaction when using e.g. deferred constraints or when using ORM and database throws error like https://www.cockroachlabs.com/docs/v21.1/transaction-retry-error-reference.html#retry_write_too_old which is then effectively hidden after PDO's There's no active transaction.

simPod avatar Oct 04 '21 08:10 simPod

@simPod thank you for the patch. I remember looking into this issue a couple of years ago. IIRC, it wasn't something trivial, so it may take some time before I post the review. But rest assured, it won't be ignored.

morozov avatar Oct 08 '21 17:10 morozov

Thank you, note taken. Take your time.

simPod avatar Oct 09 '21 10:10 simPod

Could you try rebasing so that all the required build jobs get executed?

morozov avatar Oct 20 '21 23:10 morozov

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. If you want to continue working on it, please leave a comment.

github-actions[bot] avatar Jul 30 '22 03:07 github-actions[bot]

.

simPod avatar Jul 30 '22 08:07 simPod

Closing as this pull request hasn't received significant updates in almost a year and is far from being done.

morozov avatar Sep 18 '22 19:09 morozov

@morozov I was waiting for the feedback

IIRC it was fully done and functional from my side.

simPod avatar Sep 18 '22 19:09 simPod

IIRC, it had a failing build for all this time. Didn't it? Let's reopen and double-check.

morozov avatar Sep 18 '22 19:09 morozov

I think it failed because of oracle platform or something similar. And it was related to this IIRC https://github.com/doctrine/dbal/pull/4846#discussion_r748900007

On Sun, Sep 18, 2022, 21:57 Sergei Morozov @.***> wrote:

IIRC, it had a failing build for all this time. Didn't it? Let's reopen and double-check.

— Reply to this email directly, view it on GitHub https://github.com/doctrine/dbal/pull/4846#issuecomment-1250376374, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACQAJJF4OUAS7WNOFB6YO3V65X4NANCNFSM5FI2IL7A . You are receiving this because you were mentioned.Message ID: @.***>

simPod avatar Sep 18 '22 20:09 simPod

If you plan to continue working on this patch, please ~~retarget it against 3.5.x,~~ rebase and address the build issues.

morozov avatar Sep 18 '22 20:09 morozov

It looks like the changes requested in https://github.com/doctrine/dbal/pull/4846#discussion_r733215344 got lost during the rebase.

I haven't started reviewing the patch yet. Let's get https://github.com/doctrine/dbal/pull/4846 done and this one rebased on top first.

morozov avatar Sep 23 '22 01:09 morozov

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. If you want to continue working on it, please leave a comment.

github-actions[bot] avatar Mar 04 '23 03:03 github-actions[bot]

.

simPod avatar Mar 04 '23 08:03 simPod

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. If you want to continue working on it, please leave a comment.

github-actions[bot] avatar Jun 16 '23 03:06 github-actions[bot]

D ys bs

On Fri, Jun 16, 2023, 06:01 github-actions[bot] @.***> wrote:

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. If you want to continue working on it, please leave a comment.

— Reply to this email directly, view it on GitHub https://github.com/doctrine/dbal/pull/4846#issuecomment-1594021564, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACQAJJ344WN4BIEGRJKYSLXLPEBNANCNFSM5FI2IL7A . You are receiving this because you were mentioned.Message ID: @.***>

simPod avatar Jun 16 '23 06:06 simPod

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. If you want to continue working on it, please leave a comment.

github-actions[bot] avatar Sep 16 '23 03:09 github-actions[bot]

.

On Sat, Sep 16, 2023, 06:01 github-actions[bot] @.***> wrote:

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. If you want to continue working on it, please leave a comment.

— Reply to this email directly, view it on GitHub https://github.com/doctrine/dbal/pull/4846#issuecomment-1722116081, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACQAJN62KQ2QROWMBMXIXLX2UJAZANCNFSM5FI2IL7A . You are receiving this because you were mentioned.Message ID: @.***>

simPod avatar Sep 16 '23 05:09 simPod

Bot

simPod avatar Sep 16 '23 05:09 simPod

Fix urself

simPod avatar Sep 16 '23 05:09 simPod

Can somebody fill me in what's up with this PR? It does not look like the kind of change we would accept on the 4.0.x branch.

derrabus avatar Nov 17 '23 08:11 derrabus

@derrabus see https://github.com/doctrine/orm/issues/7545 Current behavior section. The problem is that we're trying to rollback already rollbacked transaction and therefore the underlying issue (like unique constraint violation) is suppressed by There's no active transaction.

simPod avatar Nov 17 '23 10:11 simPod

Understood. Let me take over the review then. But as I said, we don't accept this kind of change on the 4.0.x branch. You need to target 3.7.x currently if this is a bugfix and 3.8.x otherwise.

derrabus avatar Nov 17 '23 12:11 derrabus

Great. I have rebased this like trillion times over the years so I'm glad there's a promise of a movement now. I'll target 3.8.x I guess.

simPod avatar Nov 17 '23 14:11 simPod

@derrabus this is now working again.

simPod avatar Dec 02 '23 16:12 simPod

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. If you want to continue working on it, please leave a comment.

github-actions[bot] avatar Mar 03 '24 03:03 github-actions[bot]