-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add :disconnect=>:retry option to Database#transaction, for automatic…
…ally retrying the transaction on disconnect This has been requested numerous times over the years. I think its a bad idea, but it's possible that it is the best alternative when dealing with a particularly bad database configuration. Basically, automatically retrying can cause all sorts of problems. The most likely way of getting it working is to only retry at transaction boundries. For a sane database that rolls back transactions on disconnect, this should work OK for pure database code. However, if you do any non-database work inside the transaction block, you need to be sure that that the work is idempotent in addition to making sure that it handles rollbacks correctly.
- Loading branch information
1 parent
2b4a5df
commit 41ab298
Showing
3 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters