While working on fixing https://hibernate.atlassian.net/browse/HHH-12107
I realized that the way we create the disassembledStateText property of the
StandardCacheEntryImpl object does not resemble the name of the attribute.
Now, I wonder why we don't build the disassembledStateText from
Currently, the disassembledStateText is built from the hydrated state
instead. Is there any reason why we do that? Is it for correlating the
disassembledState Object array that's contained in the
StandardCacheEntryImpl object with the original entity hydrated state?
The problem with HHH-12107 was that, from structured 2nd-level cache where
we content is saved as a Map, when we reconstruct the
from the Map we get from the 2nd-level cache, we only know the
disassembledState when building the StandardCacheEntryImpl object reference.
So, we can't construct the same disassembledStateText value until we have
the actual hydrated state.
We would not have this issue if the disassembledStateText was built from
the disassembledState Object array via a call to Arrays.deepToString. But
changing the way we build the disassembledStateText is problematic if the
2nd-level cache provider relies on that property.