Wrapping JDBC on thread pools is asking for trouble when running applications at scale. Applying reactive programming is opting into usage of truly non-blocking components to gain massive scalability.
A thread pool gets pretty quick exhausted. A thread pool needs a strategy to deal with overflow work. Using Executors.newFixedThreadPool(…) creates a shared unbounded queue and with this approach overflow work is likely to exhaust all JVM memory for the sake of buffering Runnables.
It would make much more sense to use a truly reactive, non-blocking infrastructure. R2DBC is a standard SPI for reactive SQL database drivers. Hibernate Rx is an ongoing investigation to provide a reactive Hibernate implementation.
Wrapping JDBC on thread pools is asking for trouble when running applications at scale. Applying reactive programming is opting into usage of truly non-blocking components to gain massive scalability.
A thread pool gets pretty quick exhausted. A thread pool needs a strategy to deal with overflow work. Using
Executors.newFixedThreadPool(…)
creates a shared unbounded queue and with this approach overflow work is likely to exhaust all JVM memory for the sake of bufferingRunnable
s.It would make much more sense to use a truly reactive, non-blocking infrastructure. R2DBC is a standard SPI for reactive SQL database drivers. Hibernate Rx is an ongoing investigation to provide a reactive Hibernate implementation.