-
-
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
Failures during commit and rollback are not handled #3995
Comments
Very likely this is the bug report for underlying PDO cause: https://bugs.php.net/bug.php?id=66528 |
Relates to the PDO issue, but not really:
So, this might be not an issue in DBAL, but in ORM. I think it's still best to be fixed in DBAL layer, as there's basically no point in not throwing exceptions in such cases, and it's quite hard and troublesome to check the return value throughout all the code. |
If you want to contribute this, you will have to target 3.0.x since it will involve a BC-break: the signature should change from Please send a PR against that branch with your suggested changes, it will make it easier to discuss this. |
This issue will be addressed in 4.0.0 (#3480). It cannot be fixed earlier since it requires an API change. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug Report
Summary
In case
PDO::commit
returnsfalse
, no exception is thrown, failures are not handled in any case.This could happen, for example, if deadlock is received when using Galera cluster.
Current behaviour
Doctrine\DBAL\Connection
returnsfalse
, which is totally ignored in all the places where it's called from, includingEntityManager
and evenConnection
internal methods.No exception is thrown.
How to reproduce
In real-world, one would need:
This bug is really critical from the business side, as application responds with success code – everything seems to be working, but database changes are not really persisted. No errors are sent to the developers about such problems, too.
Expected behaviour
Provided test case should pass –
commit
method should throw an exception in casecommit
returnsfalse
and not to just returnfalse
where it's not handled by any code whatsoever.The same, but possibly not so critical, behaviour should be applied for
rollBack
method –PDO::rollBack
can also returnfalse
.The text was updated successfully, but these errors were encountered: