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

Commits silently fail (Percona cluster + Galera plugin) #7893

Closed
Hamael18 opened this issue Nov 8, 2019 · 7 comments
Closed

Commits silently fail (Percona cluster + Galera plugin) #7893

Hamael18 opened this issue Nov 8, 2019 · 7 comments
Labels
Milestone

Comments

@Hamael18
Copy link

Hamael18 commented Nov 8, 2019

Bug Report

Q A
BC Break no
Version 2.6.4

Summary

DBAL have been recently updated. It's now 2.10 (doctrine/dbal#3588).
It fix issue with the commit() method. But it's not handled in ORM.

Current behavior

If commit() fails without exception (commit() return false but no exception), there is no information about that.

Expected behavior

Throw an exception if commit() fails and return false.

@lcobucci lcobucci added this to the 2.6.5 milestone Nov 12, 2019
@lcobucci lcobucci added the Bug label Nov 12, 2019
@lcobucci
Copy link
Member

@Hamael18 thanks. This seems to be an easy thing to solve and to isolate in a unit test.
Planning it for the next patch milestone 👍

@guilhermeblanco
Copy link
Member

@lcobucci Unfortunately this needs to be moved to 2.7, since it requires a bump in the doctrine/dbal version from ^2.6 to ^2.10 and we're not able to do this on a patch level release.

I'm moving this to 2.7, which can tolerate dependency bumps like the required one here, and we can work on a quick/simple patch after we have 2.6.5 out of the door.

@guilhermeblanco guilhermeblanco modified the milestones: 2.6.5, 2.7.0 Nov 15, 2019
@chosroes
Copy link
Contributor

    if (!$conn->commit()) {
        throw new OptimisticLockException('Commit failed', $entity);
    }
} catch (Throwable $e) {
    $this->em->close();

    if ($conn->isTransactionActive()) {
        $conn->rollBack();
    }

Small proposal for UnitOfWork::commit()
I'll not have time to made a PR with unit tests, but hope this will help someone else for a better proposal

@lcobucci
Copy link
Member

@chosroes thanks!

@lcobucci
Copy link
Member

I'm moving this to version 2.8.0 because DBAL requires PHP 7.2+ and we'll release 2.7.0 still supporting PHP 7.1+.

@cs278
Copy link

cs278 commented Aug 27, 2020

Looks like this should have been closed by 1da002c?

@beberlei beberlei modified the milestones: 2.8.0, 2.8.1, 2.8.2 Dec 4, 2020
@beberlei
Copy link
Member

Yes, fixed by #7946

@beberlei beberlei modified the milestones: 2.8.2, 2.8.0 Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants