Ron S
07/29/2023, 8:01 PMSQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30012ms.
I have a connection pool. Once the thread limit is reached, all connections hang at the INSERT statement until the exceptions are thrown after some delay. The println is never reached for these txns.
coroutineScope {
repeat(200) { i ->
launch {
newSuspendedTransaction(context = <http://Dispatchers.IO|Dispatchers.IO>) { // works fine if context parameter is null (or left out)
suspendedTransaction {
TestTable.insert { ... }
}
}
println("$i done")
}
}
}
The code works however, if I remove the parameter context
from the newSuspendedTransaction
function call.
Am I misunderstanding the capabilities of suspended txns? What do I have to change to make this code run as expected?