-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 - @ManyToOne strange behavior #4377
Comments
cc @Sanne |
@rafaelkloss could you create a simple project to reproduce it? It would be really helpful. |
Hi Guillaume, i'll do asap
Best
Em sex, 4 de out de 2019 às 12:44, Guillaume Smet <[email protected]>
escreveu:
… @rafaelkloss <https://github.com/rafaelkloss> could you create a simple
project to reproduce it? It would be really helpful.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4377?email_source=notifications&email_token=ABUKGA2JRZULXKEXTEMCI7DQM5QFDA5CNFSM4I5PW7TKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAMCGBY#issuecomment-538452743>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUKGA3IYRQ3BYSVIPFH2B3QM5QFDANCNFSM4I5PW7TA>
.
--
{ name : "Rafael Kloss",
location : "Curitiba, PR",
iata : "CWB",
twitter : ["@rafa_kloss <https://twitter.com/rafa_kloss>"}
|
i'm trying to reproduce the issue using "hibernate-orm-resteasy" project, but i cant :( |
Hi @rafaelkloss , if you could share a little project reproduing it we will debug it. Alternatively, could you try building a snapshot from Hibernate ORM master and try that? |
Hi @Sanne, what is the related issue ? |
@rafaelkloss any progress on the reproducer? We really need it to be able to fix that one. And it really looks like a nasty bug so the sooner the better! Thanks! |
BTW, the issue Sanne was talking about is this one: https://hibernate.atlassian.net/browse/HHH-13653 . It has been fixed in the current master of Hibernate ORM but we do not know if it's the same bug or not. |
Hi @rafaelkloss, Thanks |
Hi guys, sorry for delay, i'm out of office until tomorrow. I'll try to
reproduce this asap.
Em qua, 16 de out de 2019 às 07:35, Andrea Boriero <[email protected]>
escreveu:
… Hi @rafaelkloss <https://github.com/rafaelkloss>,
I have created a branch
https://github.com/dreab8/qurkus-merge-detached/tree/issue-4377 on my
repo with a test ManyToOneTest#testRequestHasAnAssociatedClient() trying
to reproduce the issue you described but without any success, can you
please tell me if I missed anything?
Thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4377?email_source=notifications&email_token=ABUKGAYHZRRYZ7JZH5CSCJTQO3VAZA5CNFSM4I5PW7TKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBMAGKY#issuecomment-542638891>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABUKGA7IFHBTTLMRQ7VRBU3QO3VAZANCNFSM4I5PW7TA>
.
--
{ name : "Rafael Kloss",
location : "Curitiba, PR",
iata : "CWB",
twitter : ["@rafa_kloss <https://twitter.com/rafa_kloss>"}
|
HI guys, i updated to Quarkus 0.25.0, but now there are other issue before described above. @dreab8 about your class model, there is a 'AbstractModel' with generic equals and hashCode methods like below:
|
Do you think the two problems are linked to each other? |
Hi @rafaelkloss can you please modify my project in order to reproduce the last issue you described? Thanks |
Hi @dreab8 i'm trying to do this right now |
Hi @dreab8 i have good news, take a look on this repository https://github.com/rafaelkloss/quarkus-many-to-one-error |
When you debug, make a breakpoint on ErrorHereServiceImpl line 30 |
@rafaelkloss thanks a lot for the reproducer, I'll look at it. |
A note from @dreab8 : this issue (also) seems related with self-dirty-tracking being enabled during build time enhancement. |
Hi guys, thanks for the effort, so far we are using 0.22.0. |
There are any workaround for this ? |
a valid workaround seems to be to disable auto dirty tracking, but Quarkus currently enforces it. (That was my choice, as having too many such options makes it hard for us to maintain all possiblities) Patching Quarkus to allow to disable this is simple enough but it's not a good idea as it would require different code being generated by Panache. Feel free to experiment with this pr? The proper solution likely belongs in an ORM (I think, I haven't spoken with @dreab8 yet) but this will need a bit more time. |
Hi Sanne, thanks for reply, i wait for the finish of issue. |
Hi guys, even i don't understand why works fine until quarkus 0.22.0, before 0.23 the "auto dirty tracking" is disabled ? |
Hi guys, any update on this ? |
Hi guys, i'm really preoccupied with this issue. What more i can do to solve this ? |
hey @rafaelkloss , I'm sorry for the delay - we had several complex issues to analyse and it's a small team :) I've been tempted to disable dirty tracking by default, but it would have been only a temporary workaround - and it would have had consequences on other features - so decided to not do that, but rather we should get to the bottom of this. We'll get back to this soon. |
@rafaelkloss there's a PR for your issue here: hibernate/hibernate-orm#3092 It's going to need careful reviewing though. @dreab8 added your use case among the integration tests, but if you'd like to have a look anyway feel free to experiment with it! |
@rafaelkloss https://github.com/hibernate/hibernate-orm/pull/3092/files#diff-53443eae565c48423e6bacc6ea9f3b0e is based on you reproducer |
Thanks :) |
hi @rafaelkloss we merged the Hibernate ORM upgrade, this should be fixed now thanks to @dreab8 . Since he ported your test to be incorporated into the ORM integration tests, I'm closing this one but please could you check on your original case as well :) |
Hi folks, thanks for your effort, this is a great new !
Very best :)
Em sex., 15 de nov. de 2019 às 08:28, Sanne Grinovero <
[email protected]> escreveu:
… hi @rafaelkloss <https://github.com/rafaelkloss> we merged the Hibernate
ORM upgrade, this should be fixed now thanks to @dreab8
<https://github.com/dreab8> .
Since he ported your test to be incorporated into the ORM integration
tests, I'm closing this one but please could you check on your original
case as well :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4377?email_source=notifications&email_token=ABUKGA2PG3BSECIJ3MLANH3QT2BXPA5CNFSM4I5PW7TKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEFFIGI#issuecomment-554325017>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABUKGA6QZIWQGXT5XGQIISTQT2BXPANCNFSM4I5PW7TA>
.
--
{ name : "Rafael Kloss",
location : "Curitiba, PR",
iata : "CWB",
twitter : ["@rafa_kloss <https://twitter.com/rafa_kloss>"}
|
Describe the bug
Imagine the relationship described below:
"one" User -> "many" Message
In Message class, there is @manytoone(fetch = FetchType.LAZY, optional = false) User user; annotation.
When a new Message instance are created, we need to persist the object on database with related User "id".
I find the related User using EntityManager.find(clazz, id)
Expected behavior
Insert the new Message on database, do not make any operation with User
Actual behavior
After insert Message, Hibernate tries to update the User instance without any field.
To Reproduce
Steps to reproduce the behavior:
Configuration
# We are using Postgres Database
Can reproduce issue only in quarkus 0.23x, on 0.22 works fine with same config.
The text was updated successfully, but these errors were encountered: