https://kotlinlang.org logo
Title
l

lifk

08/30/2017, 10:24 PM
Hey guys, not sure if this fits this channel but maybe you can help me with some issue. I have a reporting application that runs some heavy mysql queries, to make it faster I want them to run in parallel but as I see Jdbc is not parallel so in order to do it I would need a thread pool and a connection pool. Is this the way of doing it or is there a library that will make my life easier?
o

orangy

08/30/2017, 10:26 PM
It doesn’t look like something about Kotlin…
l

lifk

08/30/2017, 10:28 PM
well the application is built on kotlin and maybe there is a specific kotlin way of dealing with this that I don't know, is the answer would be the same as Java then I will investigate in other place
o

orangy

08/30/2017, 10:31 PM
I don’t think so, there are no coroutine-based SQL libraries yet, as far as I know. Check c3p0 may be? https://github.com/swaldman/c3p0
l

lifk

08/30/2017, 10:33 PM
thanks, I'll take a look
m

misko

08/31/2017, 1:47 PM
And while you are looking at C3P0 have a look at Hikari also. https://github.com/brettwooldridge/HikariCP. And as you said, since the official JDBC is blocking, you are going to need a thread pool too
d

dave08

09/02/2017, 8:42 PM
You could also look at vertx, which uses an async lib for db access, and also handles concurrancy like nodejs. Best thing of all it has support and docs for Kotlin😃