-
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
Hibernate bumps to leads to NPE when using identity generation and batching inserts #40425
Comments
/cc @DavideD (hibernate-reactive), @gavinking (hibernate-reactive) |
Hey @DavideD , could this be a regression in Hibernate Reactive? |
I guess. I will check. |
I have some test failures, but I see a different error. |
@michalvavrik Not sure if this is related, but an association in Hibernate is supposed to be mapped in a different way than the one in the tests. It should be: @Entity
class Book {
...
@ManyToOne
Author author;
...
} Is there a specific reason for the test to use just the id? |
Sorry, it was late night, if you want adjustments to the reproduce, just shout!
Hey @DavideD , In general, we just try to identify legit cases, I don't think it is required for this particular test. So we can change this. Before we do so, I'd like to understand this is not supported / encouraged use case:
I'd think that mapping only id when I don't need to work with entity is logical. I suppose if an entity instance is lazy loaded but still contains PK (that is loaded eagerly) then I can use the entity data type instead. So people shouldn't do this but it worked (with quotes :-)) in past and now the validation is improved? |
It's supported in the sense that it should work for simple cases. Not encouraged. But:
That said, I don't know the requirements for this project. |
Sorry, I couldn't figure out why it's not working in Quarkus. I couldn't really launch the test suite, when I've tried manually the validation didn't seem to work. In theory, it should call TypeSafeActivator, but something happens before reaching that point. But the debugger couldn't tell me anything. It's worth mentioning, that if something goes wrong with the creation of the validator factory, Hibernate won't say anything about it. I don't think I will have more time to work on this, if somebody wants to continue. |
Thank you for the time you put into the investigation @DavideD . |
@DavideD I prepared a minimalistic reproducer, which doesn't involve the TS.
There is also a test, UPD: It also looks like, that this error affects Postgres and Oracle, but not MariaDB, MySQL, or MSSQL |
Thanks a lot! I can finally see the nullpointer and I'm trying to figure out what's going on. |
@DavideD "debugging is a murder mystery, there you are a detective, a culprit and a victim". Can we expect a fix during this week, or we better disable the affected tests for a while? |
The latter. Even if @DavideD is going to work during his PTO (bad!), there's little chance the fix makes its way to a Hibernate Reactive release and a Quarkus release by the end of the week. |
Yes, sorry. Like Yoann said. At the moment, I can't make any promises. |
Ideally, let's make sure we have a small test in Quarkus that verifies that. |
This PR should solve the problem: hibernate/hibernate-reactive#1916 Note the Hibernate Validator wasn't the issue, the problem appears when using identity generation and batching inserts. |
@DavideD chances are I will do a 3.11.1 next Wednesday so if you can upgrade Hibernate Reactive by let's say next Monday (we have the Quarkus F2F next week so things will be a bit hectic on my side) it could be in it. |
Seems doable. |
This issue should be fixed by the Hibernate Reactive upgrade to 2.3.1.Final |
thank you |
Describe the bug
After #40102 our app has NPEs and constrain validation failures for values that are clearly within limit.
Expected behavior
No NPE, no validation failure.
Actual behavior
How to Reproduce?
The app code transforms errors to 400, so you might need to tweak it for debugging.
Output of
uname -a
orver
Fedora 38
Output of
java -version
OpenJDK 17
Quarkus version or git rev
999-SNAPSHOT
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.4
Additional information
No response
The text was updated successfully, but these errors were encountered: