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

Open Source Is Not Just About Software

  It's about infrastructure as well, something that although not attracting the limelight, is as important as the open source software it hosts. Today the stewards of the largest open source registries in the world have issued an open letter demanding urgent reform in how open source infrastructure is funded, maintained, and operated.  https://www.i-programmer.info/news/136-open-source/18334-open-source-is-not-just-about-software.html

Europe Gets Its Own LLM

  EuroLLM is a fully open-sourced large language model made in Europe and built to support all twenty-four official EU languages. While several European states have separately produced their own LLMs, such as Greece's "Meltemi" or the recent offering from Switzerland "Apertus", there was no solution that catered for the languages of all 24 states belonging to the EU block. The time has come for this status to change with the appearance of EuroLLM, a foundational model that supports them all. https://www.i-programmer.info/news/105-artificial-intelligence/18448-europe-gets-its-own-llm.html

With MCP Docs Servers You'll Never Run Out Of Fresh Documentation

  MCP has changed the way you interact with your tools overnight. Now it targets your documentation. Wouldn't be great to have the latest and updated code samples and documentation of your favorite framework and libraries ready at your fingertips? Plus, be able to talk to it in natural language? https://www.i-programmer.info/news/90-tools/18248-with-mcp-docs-servers-youll-never-run-out-of-fresh-documentation-.html