Skip to content

An extra UPDATE is triggered when using records - #619

Open
dyleph wants to merge 6 commits into
vladmihalcea:masterfrom
dyleph:save-with-a-nested-Map-Map
Open

An extra UPDATE is triggered when using records#619
dyleph wants to merge 6 commits into
vladmihalcea:masterfrom
dyleph:save-with-a-nested-Map-Map

Conversation

@dyleph

@dyleph dyleph commented Apr 24, 2023

Copy link
Copy Markdown

No description provided.

@vladmihalcea

Copy link
Copy Markdown
Owner

Thanks. It's much better. I'll check it out tonight.

@dyleph

dyleph commented Apr 24, 2023

Copy link
Copy Markdown
Author

Thank you @vladmihalcea . Sorry for late. Because I was in my holiday since Friday :)
Have a nice day!

@vladmihalcea

Copy link
Copy Markdown
Owner

Likewise

@vladmihalcea

Copy link
Copy Markdown
Owner

The problem comes from the areEqual method which finds different internal Map types.

@dyleph

dyleph commented Apr 25, 2023

Copy link
Copy Markdown
Author

Is this problem from hypersistence-utils?

@vladmihalcea

vladmihalcea commented Apr 25, 2023

Copy link
Copy Markdown
Owner

If you replace the record with a POJO that has equals and hashCode, it will work.

I will see how to accommodate a fix when I get some time.

@vladmihalcea vladmihalcea changed the title Check Book's version after saving An extra UPDATE is triggered when using records Apr 25, 2023
@dyleph

dyleph commented May 9, 2023

Copy link
Copy Markdown
Author

Hi @vladmihalcea ,
Do we have any updates with this issue?

Regards,
Dy

@vladmihalcea

Copy link
Copy Markdown
Owner

@dyleph This is a very complex issue, and you are better off using JsonNode or type-safe POJOs on the entity attribute that maps the JSON if you want to avoid it.

I'm not sure when I'll have time to fix it since the problem is caused by records that can be contained on any hierarchical level in a Map of Map structure you're now using.

But, as long as you have some workarounds, you should those instead.

@vladmihalcea
vladmihalcea force-pushed the master branch 2 times, most recently from a901c16 to 733fdde Compare January 27, 2026 14:53
@vladmihalcea
vladmihalcea force-pushed the master branch 3 times, most recently from e8c995e to 060a7ee Compare June 2, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants