mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
[CORDA-2807] Don't retry db transaction in AbstactNode start (#4942)
Retries can lead to confusing error messages in case the CFT notary is misconfigured and throws a SQLException causing a retry.
This commit is contained in:
committed by
josecoll
parent
d9e11b21ae
commit
dc46446432
@ -227,6 +227,15 @@ class CordaPersistence(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes given statement in the scope of transaction with the transaction level specified at the creation time.
|
||||
* @param statement to be executed in the scope of this transaction.
|
||||
* @param recoverableFailureTolerance number of transaction commit retries for SQL while SQL exception is encountered.
|
||||
*/
|
||||
fun <T> transaction(recoverableFailureTolerance: Int, statement: DatabaseTransaction.() -> T): T {
|
||||
return transaction(defaultIsolationLevel, recoverableFailureTolerance, false, statement)
|
||||
}
|
||||
|
||||
private fun <T> inTopLevelTransaction(isolationLevel: TransactionIsolationLevel, recoverableFailureTolerance: Int,
|
||||
recoverAnyNestedSQLException: Boolean, statement: DatabaseTransaction.() -> T): T {
|
||||
var recoverableFailureCount = 0
|
||||
|
Reference in New Issue
Block a user