-
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
entityManager.merge does not work in some cases #38722
Comments
Hey @alomine, thanks for reporting. |
Hello @yrodiere, thanks for response. |
Thanks, looking forward to the reproducer. |
@yrodiere |
My guess is that it's related to the bytecode enhancement. |
I have some research on this issue.1. Transactional annotation on the TestBugTest class instead of TestEntityService.All tests will be passed, but the data in the database will not be updated. 2. QuarkusTransaction instead of annotation. You will have two possible variants:2.1 Test fail, data not updated.
2.2 Test passed, data not updated (similar to placing the Transactional annotation on the TestBugTest class).
3. Update "refreshed" data after save (Transactional on TestEntityService).3.1 Works as intended data in db updated.
3.2 Save and find. Works similar to 3.1
I hope this helps in some way. |
Hello @Nikita-V0lkov, |
Hey,
As Guillaume suggested, you'd need to add bytecode enhancement to reproduce the issue with Hibernate ORM only. Here's a bug report based on this in ORM's JIRA: https://hibernate.atlassian.net/browse/HHH-17761 |
Is there a way to disable hibernate bytecode enhancement on quarkus ? |
There is not, and there are no plans to allow it. |
Describe the bug
Hello!
In some cases hibernate entityManager.merge fails to update some fields when setting them to null. I have prepared some test cases to show when it works just fine and when it fails. Fails are when database fields are null except the one that needs to be set to null AND its not date field (which somehow works).
Case might be similar to:
#22080
and
#2815
Also if something is not clear or i need to provide more info, please feel free to ask
Expected behavior
All tests in given repository should pass
Actual behavior
2 of 6 tests fails. You can see in logs that update is not made
How to Reproduce?
Simply use
.\mvnw test
in my projectOutput of
uname -a
orver
Output of
java -version
17
Quarkus version or git rev
3.7.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)mvnw
Additional information
No response
The text was updated successfully, but these errors were encountered: