fix: make JSONB value types Serializable for Ehcache L2 cache (backport to 2.43)#24052
Open
netroms wants to merge 2 commits into
Open
fix: make JSONB value types Serializable for Ehcache L2 cache (backport to 2.43)#24052netroms wants to merge 2 commits into
netroms wants to merge 2 commits into
Conversation
…rt to 2.43) Backport of #24042. Ehcache's SerializingCopier performs real Java serialization of L2-cached entity state, so every JSONB value type on a cached entity must implement java.io.Serializable. 2.43 is still on Ehcache 3.10.8 (where this does not yet bite), so this is future-proofing plus the guard test that locks the invariant in before the eventual 3.12 bump. - RenderingObject: extend Serializable (covers Section/ValueTypeRenderingObject) - ApiTokenAttribute: implement Serializable (folds in #24002, never backported; ApiToken is L2-cached) - add CachedEntityJsonbSerializableTest guard walking the live Hibernate metamodel so this cannot regress silently Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mvn dependency:analyze flags the new test's JsonBinaryType import as a used-undeclared dependency. The ignoredNonTestScopedDependencies entry only suppresses the scope check, not used-undeclared, so declare the dependency explicitly (compile scope), matching master. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Backport of #24042 to 2.43.
Ehcache's
SerializingCopierperforms real Java serialization of L2-cached entity state, so every JSONB value type on a cached entity (and its whole object graph) must implementjava.io.Serializable.Note: 2.43 is still on Ehcache 3.10.8, where this does not yet manifest (the regression appears with the 3.12
SerializingCopier, which is already on master and 2.42). This backport is therefore future-proofing, and the guard test locks the invariant in before 2.43 eventually bumps to 3.12.Changes
RenderingObjectextendsSerializable(transitively coversSection/ValueTypeRenderingObject).ApiTokenAttributeimplementsSerializable. Folds in fix: make ApiTokenAttribute Serializable for Ehcache L2 cache #24002, which was never backported to 2.43;ApiTokenis L2-cached, so it would hit the sameNotSerializableExceptiononce 2.43 is on 3.12. Required for the guard test to pass.CachedEntityJsonbSerializableTest, which walks the live Hibernate metamodel and asserts every JSONB value type on an L2-cached entity isSerializable, so this cannot regress silently.Verification
Guard test run locally against Postgres on this branch: 2 tests, 0 failures.
AI Assisted