fix: make RenderingObject Serializable for Ehcache L2 cache#24042
Merged
Conversation
Ehcache 3.12.0 uses SerializingCopier which requires Java serialization of cached entity state. RenderingObject is stored as DeviceRenderTypeMap values in JSONB columns on the L2-cached ProgramSection and ProgramStageSection entities, but lacked Serializable, which would break cache serialization. Also adds CachedEntityJsonbSerializableTest, a metamodel-driven guard asserting every JSONB value type on an L2-cached entity is Serializable, so this cannot regress silently. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
stian-sandvold
approved these changes
May 31, 2026
Declare dhis-support-hibernate in dhis-test-integration so mvn dependency:analyze no longer fails on the used-undeclared JsonBinaryType import (broke unit-test and sonarqube). Skip untyped jbObject (java.lang.Object) columns in the guard test. Jackson materialises untyped JSONB into serializable JDK types (LinkedHashMap/ArrayList/String/Number/Boolean), so MapView#styleDataItem is cache-safe and was a false positive (broke integration-test). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolves SonarCloud code smell java:S6126 (the only new-code-smell failing the quality gate) by replacing the concatenated failure message with an equivalent text block. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This was referenced May 31, 2026
jbee
approved these changes
Jun 1, 2026
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.



Summary
RenderingObjectextendSerializableso the ehcache L2 cache (SerializingCopier, since the 3.12 bump in chore(deps): bump org.ehcache:ehcache from 3.10.8 to 3.12.0 in /dhis-2 #23834) can serialize it. It is stored asDeviceRenderTypeMapvalues in JSONB columns on the L2-cachedProgramSectionandProgramStageSectionentities. Same root cause as fix: make ApiTokenAttribute Serializable for Ehcache L2 cache #24002.CachedEntityJsonbSerializableTest, a metamodel-driven guard asserting every JSONB value type on an L2-cached entity isSerializable, so this class of regression cannot return silently.An audit of all L2-cached entities (hbm
<cache>and@Cache) found no other non-serializable JSONB value types.AI Assisted