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
Example fails with ORM 5.4.24 #453
Comments
Goops, you're right: @Sanne and I both missed this because of other spurious failures in the CI. |
I hazard a guess that this is related to #443. |
Is that issue related to DirtyChecking? Anyway, it happens after the update to ORM 5.4.24 |
Well, I figured that the bug is related to batch loading. I might be wrong though. |
Oh well, it looks like I'm wrong and the problem is indeed elsewhere. |
I'm working on a test case. Hopefully I will be able to confirm this soon enough. It makes sense though because only the example fails and it is the only place where we enable the bytecode enhancements |
OK, great. |
So, yes. The problem is the dirty checking of the collection when byte code enhancements are enabled. I don't know why it was working before. Probably, this bug in ORM was hiding the problem and now that it's fixed we see it. |
Uff, what a PITA. |
OTOH, why does collection dirty checking even matter when we don't even have |
This is the issue: The enhanced method
to
the call to |
|
@DavideD so do you think that what is going on here is just that we don't have transparent lazy init (i.e. it is missing a call to |
@DavideD I've commented on hibernate/hibernate-orm#3645, because that call to |
I think that's the issue. I'm trying to see if I can fetch the collection somewhere so that it is already fetched. |
OK, but don't kill yourself on that right now because it still feels wrong to me that we're fetching an un fetched association with (OTOH, even if core isn't doing the right thing in this particular case, we still might need the fix your working on in other cases.) |
For additional info, this is branch with the test case (still a work in progress): https://github.com/DavideD/hibernate-reactive/tree/447-dirtychecking |
Thanks @gavinking |
Why is the movies collection |
Well I recall that there was a kinda long discussion somewhere. An issue I opened where I argued that this "double-laziness" or collections was at least arguably bad in Hibernate ORM, and a much worse problem for HR, where fetching isn't transparent. We need to let you obtain a reference to the collection to call |
OK found it. So could this be related to #374? |
Is |
Hmm, if I set it to true, the collection is eagerly initialized. |
Yup, it is. |
Ummmm ... really? That wasn't the intention! |
So either I totally screwed up, or something has changed since I wrote that code. |
I'm with you that the current approach to enhancement is not ideal and that the field should be initialized to a persistent collection, but I think that the issue you are having in RX might be caused by something else. When I set the flag to true, I see the collection being initialized through this trace:
|
So |
I'm probably missing something, but isn't this the same issue? |
You are right. Apparently the collections aren't registered as being lazy which causes this problem. I'm investigating now. |
Here a PR that should fix these issues: hibernate/hibernate-orm#3664 |
Thanks @beikov, the test seems to work using that branch |
@beikov excellent, thanks |
Confirmed, we just need a release of |
Fixed by #463 Thanks all |
Example of one of the logs using
org.hibernate:hibernate-core:5.5.0-SNAPSHOT:20201117.201048-196
:The text was updated successfully, but these errors were encountered: