Hibernate Reactive Panache combines Panache’s simplified data-access model with reactive programming and nonblocking SQL clients. Persistence results use Uni<E> or Uni<List<E>> rather than blocking entity or collection types, representing asynchronous computations that complete later. section 7.7.1
Adopting Hibernate Reactive Panache in a Quarkus service requires coordinated dependency, configuration, and model changes:
- Replace quarkus-hibernate-orm-panache and quarkus-jdbc-postgresql with quarkus-hibernate-reactive-panache and quarkus-reactive-pg-client. section 7.7.1
- Replace the blocking REST Data Panache extension with quarkus-hibernate-reactive-rest-data-panache when REST Data is used. section 7.7.1
- Configure the reactive PostgreSQL URL, while retaining the other datasource properties and Hibernate database-generation setting. section 7.7.1
- Change entity and resource imports to the reactive Panache packages; the entity structure otherwise remains the same. section 7.7.1
Nonblocking persistence endpoint
A JAX-RS method can return Uni<Reservation> directly. Calling persist() produces the asynchronous result, and onItem().call(...) chains work that continues after persistence completes. Quarkus can keep the I/O thread available while the database processes the insert. section 8.4.1
