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

Closed
opened 2026-01-22 15:31:21 +01:00 by admin · 7 comments
Owner

Originally created by @Hamael18 on GitHub (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 (https://github.com/doctrine/dbal/pull/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.

Originally created by @Hamael18 on GitHub (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 (https://github.com/doctrine/dbal/pull/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.
admin added the Bug label 2026-01-22 15:31:21 +01:00
admin closed this issue 2026-01-22 15:31:21 +01:00
Author
Owner

@lcobucci commented on GitHub (Nov 12, 2019):

@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 👍

@lcobucci commented on GitHub (Nov 12, 2019): @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 :+1:
Author
Owner

@guilhermeblanco commented on GitHub (Nov 15, 2019):

@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 commented on GitHub (Nov 15, 2019): @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.
Author
Owner

@chosroes commented on GitHub (Nov 15, 2019):

    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

@chosroes commented on GitHub (Nov 15, 2019): ```php 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
Author
Owner

@lcobucci commented on GitHub (Nov 15, 2019):

@chosroes thanks!

@lcobucci commented on GitHub (Nov 15, 2019): @chosroes thanks!
Author
Owner

@lcobucci commented on GitHub (Nov 15, 2019):

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+.

@lcobucci commented on GitHub (Nov 15, 2019): 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+.
Author
Owner

@cs278 commented on GitHub (Aug 27, 2020):

Looks like this should have been closed by 1da002ca2f84d9d5da11b4c60e24d957cb8f6c16?

@cs278 commented on GitHub (Aug 27, 2020): Looks like this should have been closed by 1da002ca2f84d9d5da11b4c60e24d957cb8f6c16?
Author
Owner

@beberlei commented on GitHub (Dec 13, 2020):

Yes, fixed by https://github.com/doctrine/orm/pull/7946

@beberlei commented on GitHub (Dec 13, 2020): Yes, fixed by https://github.com/doctrine/orm/pull/7946
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6339