-
Notifications
You must be signed in to change notification settings - Fork 368
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
Avoid the unnecessary UPDATE for JsonNode entity mappings #348
Comments
@victornoel Check out this test case that validates the number of statements that get generated. You can use that as a template for a new test case that uses your mapping and replicates the issue. If you can replicate it, send me a Pull Request so I can take a look at it. Looking forward to it. |
@vladmihalcea thank you, here it is: #349 |
@vladmihalcea a few related issues at jackson that are related to this (and could be a good justification for considering this not a bug in hibernate-types ;)):
By the way the workaround proposed there does not solve the problem, so maybe not related ^^ |
@victornoel Thanks for investigating it. Indeed, using |
@vladmihalcea using I looked a bit around the various bugs in Jackson and also did some tests, and I'm still not clear why it doesn't work as it should, because if I just deserialize my json as But I'm not familiar enough with hibernate-types to clearly understand what is used to do that dirty check in practice, so I suppose you will be more efficient than me to understand what's happening ^^ |
If only I had the time to investigate it. I usually investigate issues that are either critical or there's a company who wants to sponsor the fix. I'll let the issue open for a while to see if anyone wants to provide a good fix for this. |
Ok, I will see if I can investigate it a bit when I get some time then :) Thx for your guidance to reproduce it with simple setup in any case! |
@victornoel You're welcome. Looking forward to reviewing your fix. |
@vladmihalcea so, first results of investigation:
Next I will try to see what could be the best way to improve this. I guess there are good reasons to rely on java deserialization by default? I know that I also saw that it is possible to implement a custom Thanks! |
(I have pushed a first naive fix just to demonstrate it :) |
I have also opened FasterXML/jackson-databind#3296 but:
|
@victornoel Thanks. I'll investigate it when I have some spare time. It's just that I'm very busy at the moment. |
@vladmihalcea no worries, whenever you can, this is not urgent nor blocking for me :) (actually, even if it was :P) |
Fixed. |
@vladmihalcea thx :) |
Hi,
I'm hitting a strange bug using hibernate-types 2.12.0 and hibernate 5.4.32 and I'm still investigating it, but thought I could already raise it here in case someone had an idea about it :)
Basically, I have one class:
I declared the json type with:
I'm using
MariaDB103Dialect
and I also register the following:I also use the bytecode enhancement for dirty checking.
And I have a class with a field:
And then I persisted such an object with
state
with value{"field":0.05}
.When I retrieve it with the hibernate session, every time there is a flush, the dirty checking mechanism is triggered and tells me the value of
state
changed even though it wasn't, and an update statement is issued to the db (which include updating the version field of my object, which I don't want :)The text was updated successfully, but these errors were encountered: