1 year ago
#349524
user2625402
How to parallelize a task in which there are requests to a db?
I have a kotlin application and a Spring JdbcTemplate and a Hikary connection pool with two connections.
And I have the task that is a good candidate for parallel execution.
It's a list of strings:
List<String>
which turns into list of lists after splitting:
List<List<String>>
and i can take its chunks and make sql queries to db separately. All chunks are independent of each other.
The result of work of these subtasks is total list of responses.
The question is - how to prevent degradation of performance and avoid wait connection time out?
May be exsits better way to hadle faster large list intended for db queries...
java
kotlin
kotlin-coroutines
connection-pooling
jdbctemplate
0 Answers
Your Answer