exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/v1/jdbc/transactions/Transactions.kt [190:229]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - try { executeTransactionWithErrorHandling(transaction, shouldCommit = true) { transaction.db.config.defaultSchema?.let { SchemaUtils.setSchema(it) } transaction.statement() } } catch (cause: SQLException) { handleSQLException(cause, transaction, attempts) throw cause } } } catch (cause: SQLException) { attempts++ if (retryInterval == null) { retryInterval = transaction.getRetryInterval() intermediateDelay = transaction.minRetryDelay } val retryDelay = when { transaction.minRetryDelay < transaction.maxRetryDelay -> { intermediateDelay += retryInterval * attempts ThreadLocalRandom.current().nextLong(intermediateDelay, intermediateDelay + retryInterval) } transaction.minRetryDelay == transaction.maxRetryDelay -> transaction.minRetryDelay else -> 0 } exposedLogger.debug("Wait $retryDelay milliseconds before retrying") try { Thread.sleep(retryDelay) } catch (cause: InterruptedException) { // Do nothing } if (attempts >= transaction.maxAttempts) { throw cause } } finally { @OptIn(InternalApi::class) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/v1/jdbc/transactions/Transactions.kt [337:376]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - try { executeTransactionWithErrorHandling(transaction, shouldCommit = true) { transaction.db.config.defaultSchema?.let { SchemaUtils.setSchema(it) } transaction.statement() } } catch (cause: SQLException) { handleSQLException(cause, transaction, attempts) throw cause } } } catch (cause: SQLException) { attempts++ if (retryInterval == null) { retryInterval = transaction.getRetryInterval() intermediateDelay = transaction.minRetryDelay } val retryDelay = when { transaction.minRetryDelay < transaction.maxRetryDelay -> { intermediateDelay += retryInterval * attempts ThreadLocalRandom.current().nextLong(intermediateDelay, intermediateDelay + retryInterval) } transaction.minRetryDelay == transaction.maxRetryDelay -> transaction.minRetryDelay else -> 0 } exposedLogger.debug("Wait $retryDelay milliseconds before retrying") try { Thread.sleep(retryDelay) } catch (cause: InterruptedException) { // Do nothing } if (attempts >= transaction.maxAttempts) { throw cause } } finally { @OptIn(InternalApi::class) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -