Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus reactive core with Panache reactive and Panache JPA #21199

Closed
cristianorvf opened this issue Nov 4, 2021 · 5 comments
Closed

Quarkus reactive core with Panache reactive and Panache JPA #21199

cristianorvf opened this issue Nov 4, 2021 · 5 comments

Comments

@cristianorvf
Copy link

cristianorvf commented Nov 4, 2021

Based on reading the blog post RESTEasy Reactive - To block or not to block

How to setup hibernate reactive + JPA for accessing EntityManager + PanacheRepository (classic) or PanacheRepository (reactive) based on signatures ?

One understands that defaults for reactive and blocking has changed, ok.. nice. But also for the same post we can infer that things like @Transacional are infered to be blocking, and that the transactional manager should work over JPA (since its blocking.)

Meaning, in the end that we can conbine both worlds in the same application. I've tried to setup such project without success where hibernate conflicts between hibernate reactive and JPA.

In my understanding things should work like (using panache for example..)

  • Add panache hibernate reactive
  • Add panache hibernate JPA
  • Setup two datasources (r2dbc and jdbc)
  • When use @Transacional the classic path happens (use EntityManager , ThreadLocals, transaction support) and is possible to use normal PanacheEntity with PanacheRepository classic
  • When returning Unis and Multis things hapen with reactive in I/O Threads.. using PanacheRepository from reactive package

So, is this possible or did i get it wrong?

Whats is the POM for non-conflict ?

@quarkus-bot
Copy link

quarkus-bot bot commented Nov 4, 2021

/cc @FroMage, @loicmathieu

@MartinX3
Copy link

MartinX3 commented Nov 4, 2021

What's a PanacheReactiveRepository? I don't find it in google or in your link.

@cristianorvf
Copy link
Author

cristianorvf commented Nov 4, 2021

What's a PanacheReactiveRepository? I don't find it in google or in your link.

Sorry! I was writing the question with lots of code open in my IDE which uses spring data and spring data reactive in two separete projects.. there it uses a separation via class names for repos so my mind messed up when i was writing! What i meant was to use the two separate Repositories (which are separated via packages in quarkus..)

io.quarkus.hibernate.orm.panache.PanacheRepository;
io.quarkus.hibernate.reactive.panache.PanacheRepository;

The question stil remains, there is one repo with reactive signatures and other with classic, i would like to use both in the same project, possibily with two connection pools (one via r2dbc Mutity and one JDBC agroal.)

@MartinX3
Copy link

MartinX3 commented Nov 4, 2021

Like this? https://quarkus.io/guides/datasource (found via google)

@cristianorvf
Copy link
Author

Like this? https://quarkus.io/guides/datasource (found via google)

No, not exactly.. but based on my exception i found this: #13425

Im closing since the other one is older, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants