Skip to main content

Hibernate goes Reactive - What Does That Mean?

 Hibernate Reactive Version 1.00 fosters non-blocking I/O access to the database plus reactive extensions. Let's get under the covers and find our why this helps.


First a definition of the problem. JPA/JDBC was always blocking, meaning that any operation that touches the database through JDBC operations will block on socket IO, and when that's happening the thread it is running on will be blocked.


So that means that when I make a call to the database from my main thread, the thread will block until the driver returns the results of the query. Then what about wrapping that call in a CompletableFuture to make the call asynchronous and wait on the Future instead, calling my callback when the database operation completes? That way don't I need a non-blocking driver after all?Perhaps, but since the stack is not non-blocking all the way down, there are certain disadvantages.


But why should the stack be non-blocking all the way down?


full article on i-programmer:

https://www.i-programmer.info/news/80-java/15025-hibernate-goes-reactive-but-what-does-that-mean.html



 

Comments

Popular posts from this blog

Spatial Data Management For GIS and Data Scientists

  Videos of the lectures taught in Fall 2023 at the University of Tennessee are now available as a YouTube playlist. They provide a complete overview of the concepts of GeoSpatial science using Google Earth Engine, PostgresSQL GIS , DuckDB, Python and SQL. https://www.i-programmer.info/news/145-mapping-a-gis/16772-spatial-data-management-for-gis-and-data-scientists.html