-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Don't force flush mode to FlushMode.ALWAYS #41284
Conversation
Leave the flush mode to its default value in Hibernate ORM, which should smartly flush when necessary, and no more.
/cc @gsmet (hibernate-orm) |
Status for workflow
|
Hey @yrodiere, I'm currently testing 3.13.0.CR1 and I had to switch from I wonder whether there should be a note in the migration guide? |
Hey,
That's... interesting. And seems to point at a bug in Hibernate ORM, which maybe doesn't auto-flush before foreign key updates. At the very least this looks like a limitation, which the docs currently fail to mention (unless you're executing a native query?). Could you please create an issue with a reproducer based on this template? We might want the Hibernate ORM team to have a look.
To clarify, are we just talking about a regression in Quarkus, or are we also talking about a behavior that used to match that of Spring Data, and no longer does? I'd expect Spring Data to behave the same as we now do, to be honest...
Definitely, will do. Thanks for pointing this out. |
@yrodiere thanks for enhancing the migration guide.
No, it's a JPQL query (AFAICS): https://quarkus.io/guides/spring-data-jpa#user-defined-queries
Haven't checked native Spring. It's a regression in the first place.
I was able to reproduce the issue with the Quarkus |
Leave the flush mode to its default value in Hibernate ORM, which should smartly flush when necessary, and no more.
Discussed with more knowledgeable people here, and this seems like the right thing to do. I wouldn't backport though, as you can expect some behavior changes -- though mostly (only?) for the better.
Fixes #41115