doctrine / dbal

Doctrine Database Abstraction Layer
https://www.doctrine-project.org/projects/dbal.html
MIT License
9.49k stars 1.34k forks source link

DBAL-1035 #718 Identify retryable transaction errors and cause them to raise specific exception type #966

Closed doctrinebot closed 8 years ago

doctrinebot commented 10 years ago

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of Tobion:

Url: https://github.com/doctrine/dbal/pull/718

Message:

It is best practice to implement retry logic for transactions that are aborted because of deadlocks or timeouts. This makes such method available inside the DBAL and also adds detection for errors where retrying makes sense in the different database drivers.

Deadlocks and timeouts are caused by lock contention and you often can design your application to reduce the likeliness that such an error occurs. But it's impossible to guarantee that such error conditions will never occur. This is why implementing retrying logic for such errors is actually a must when you have to ensure the application does not fail in edge cases or high load. Some references where something similar has already been implemented:

I chose the name retryable because it is consistent with transactional. I think the implementation is quite straight forward and fits very well with the DBAL design.

doctrinebot commented 9 years ago

Comment created by @doctrinebot:

A related Github Pull-Request [GH-718] was labeled: https://github.com/doctrine/dbal/pull/718

deeky666 commented 8 years ago

Fixed in #718

github-actions[bot] commented 2 years ago

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.