My current project is now completely non-blocking ...
# server
b
My current project is now completely non-blocking behind coroutines EXCEPT for JDBC connecting to MySQL 😢
n
if the source is blocking, i suppose the rest being non-blocking offers no advantage could you elaborate on this decision?
b
In the case of JDBC, I have a thread pool for those queries to block on. So the calls are still asynchronous behind coroutines, but are still blocking on that thread pool. I haven’t found a non-blocking replacement for MySQL database queries, so I’m stuck with JDBC at the moment.
I would LOVE a truly non-blocking MySQL connection implementation though that I could put behind coroutines. The Ktor raw sockets look like a potential socket provider, but it’s not so simple to manually implement MySQL network traffic
oh, sorry, I saw this in the next thread only after posting ...
b
Right, there’s these talks, but no real JRE support as of yet. There’s work towards it that appears to be in a ā€œnot ready yet…maybe next versionā€ cycle for the time being
Also, to note that ADBA is Oracle-specific the last that I have heard
It is not intended to be an extension to, or a replacement for, JDBC but, rather, an entirely separate API that provides completely nonblocking access to the same databases as JDBC.
n
thanks for your answer did you benchmark before and after? and if yes, can you provide the results?
o
Do you need a JDBC API, or just async execute?
Also, there is this: https://github.com/pgjdbc/pgsql2 It’s not MySQL, but a working SQL2 (new async DB API) implementation
b
@orangy Just async access to MySQL is needed
o
ā€œaccessā€ can mean anything šŸ™‚ what operations do you need to execute? do you need some framework, like Hibernate to work with it? Other ORMs? Caches?
Do you need to read/modify a schema?
Or just send some raw SQL and get rows back?
b
Nope, just the records themselves – SELECT, INSERT, UPDATE, DELETE I use requery, but I’d be happy to work on getting around that
o
as far as I understand, #squash is very much like requery? I think both a based on ideas from #exposed
and jooq to some extent
b
Doesn’t squash still have the same issue with JDBC being blocking?
o
Right now yes, but there is a branch with coroutines
n
o
@napperley yes, and we are building our own
n
Iiya - Will these libs be multi-platform?
o
Of course. But not very soon