Skip to content
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

HHH-2781 Test caching of non-updatable state #9538

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

beikov
Copy link
Member

@beikov beikov commented Jan 2, 2025


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-2781

@beikov
Copy link
Member Author

beikov commented Jan 2, 2025

The problem is that we use the entity state as it is in org.hibernate.action.internal.EntityUpdateAction#updateCacheItem, whereas we should be using the previous state for non-updatable column values, which might not be so simple if the non-updatable column is part of e.g. an embeddable and another field of that embeddable is dirty.

A possible solution might be to pass the loadedState into org.hibernate.persister.entity.EntityPersister#buildCacheEntry and implement the assembling/disassembling that is currently implemented through org.hibernate.type.Type via ModelPart instead and try to respect updatability in that new implementation, using the loadedState if needed.

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.

1 participant