• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Pro Spring MVC with Webflux

 
Bartender
Posts: 1330
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi authors,

first of all, good luck for your book ! I wish to ask you a question about WebFlux and, more generally, about reactive approach in Java.
I'm just approaching to this programming style, and at the moment the most important problem I can see in adopting reactive approach is the lack of (wide) support for relational databases.
Also , we have a number of already well established  application @Services in our programs, most of which  perform somehow data access, in a transactional way.  
As far as I know, a number of annotations like @Transactional rely upon ThreadLocal variables, and ThreadLocal doesn't cope well with reactive approach.
Is there a way to avoid throwing away all good old style code and somehow get any of the benefits of the reactive approach ? A better multi-threading without callback hell approach would be enough, at least as a first step.

Thanks in advance !
 
Author
Posts: 6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Spring (Boot) has out-of-the-box support for R2DBC and Spring has reactive transaction support with @Transactional. So even with a reactive approach it is now possible to expose your database in a reactive way.
 
Claude Moore
Bartender
Posts: 1330
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply Marten ! Does it apply also for JPA ? I think that the short answer is 'no', I heard about an Hibernate project aimed to introduce support to Reactive DBMS, but I don't know what's the state of the art of such project...
 
Marten Deinum
Author
Posts: 6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JPA, currently, relies on JDBC and thus is blocking. There is Hibernate Reactive however that isn't really tailored to be used outside of Quarkus I believe. It doesn't integrate the common know Reactive libraries (RxJava and Project Reactor) but only supports Mutiny and AFAIK doesn't play nice with other Reactive implementations. Although you could use the regular Async API as it seems. BUt there still isn't support in Spring for that (nor would I expect that shortly) so you would have to write parts of the integration yourself I suspect.
 
reply
    Bookmark Topic Watch Topic
  • New Topic