-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: EXPOSED-80 Set repetition policy for suspended transactions (#1774)
* fix: EXPOSED-80 Set repetition attempts and delay for suspended transactions Refactor suspended transaction functions to implement a similar retry policy to normal transactions: - repetitionAttempts - minRepetitionDelay - maxRepetitionDelay These are placed as mutable properties inside Transaction class so they can be easily accessible if needed inside a block. The properties have been removed from `transaction()` for consistency across both types. A transaction block with no specified repetitions previously used the default values set in DatabaseConfig, so the Transaction class properties also match that. Add unit tests that simulate a constraint violation and concurrent update, which is only resolved by multiple statement retries. Rename nested function parameter from `_tx` to `currentTransaction`, in order to remove Detekt warning about `FunctionParameterNaming` starting with underscore. Also refactored lines that use that variable to not create new warnings about maxLineLength. Rename `Transaction.suspendedTransaction()` to `Transaction.withSuspendTransaction()`, since it calls the provided suspending block within a `Transaction` that is suspendable. Add KDocs to public functions in Suspended.kt.
- Loading branch information
Showing
14 changed files
with
381 additions
and
130 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
Oops, something went wrong.