Skip to content

fix: make RenderingObject Serializable for Ehcache L2 cache#24042

Merged
netroms merged 4 commits into
masterfrom
fix/ehcache-serializable-jsonb-types
Jun 1, 2026
Merged

fix: make RenderingObject Serializable for Ehcache L2 cache#24042
netroms merged 4 commits into
masterfrom
fix/ehcache-serializable-jsonb-types

Conversation

@netroms
Copy link
Copy Markdown
Contributor

@netroms netroms commented May 31, 2026

Summary

An audit of all L2-cached entities (hbm <cache> and @Cache) found no other non-serializable JSONB value types.

AI Assisted

netroms and others added 2 commits May 31, 2026 11:28
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>
netroms and others added 2 commits June 1, 2026 01:45
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>
@sonarqubecloud
Copy link
Copy Markdown

@netroms netroms merged commit 19e4bbe into master Jun 1, 2026
22 checks passed
@netroms netroms deleted the fix/ehcache-serializable-jsonb-types branch June 1, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants