I work with Oracle and Mysql, and I try to understand why the APIs are not written so that I can call, leave and do something else, and then come back and pick it up later, for example, NIO - I forcibly devote the thread to waiting for data. It seems that SQL interfaces are the only place where IO synchronization is still forced, which means binding a thread waiting for DB.
Can someone explain the reasons for this? Is there something fundamental that makes this difficult?
It would be great to be able to use 1-2 threads to manage my database query problem and retrieve the result, rather than use worker threads to retrieve data.
I note that there are two experimental attempts (for example: adbcj) when implementing the asynchronous API, but none of them are ready for use in Production.
source
share