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

JCacheCache doesn't recognize null values in other JVMs [SPR-13553] #18129

Closed
spring-projects-issues opened this issue Oct 8, 2015 · 3 comments
Closed
Assignees
Labels
in: core status: backported type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Oct 8, 2015

John J Kennedy opened SPR-13553 and commented

The JCacheCache class uses an instance variable called "NULL_HOLDER" to check for a null value. The problem is that it uses == as the test. This won't work in multiple JVMs since one JVM could put a value in cache and another could retrieve it.

I believe it should use a class-based comparision like
storeValue.getClass() == NullHolder.class


Affects: 3.2.14, 4.1.7, 4.2.1

Issue Links:

  • #20252 AbstractValueAdaptingCache does not allow for flexible null value serialization

Referenced from: commits de93290, 6c138d3, 112781f

Backported to: 4.1.8, 3.2.15

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 8, 2015

John J Kennedy commented

I can make a pull-request for this, if you want.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 8, 2015

Juergen Hoeller commented

Indeed, the NullHolder class should be designed to expect unique deserialization. The cleanest approach would be to declare a readResolve() method that always resolves to the canonical instance. I'll have a look at this for 4.2.2 and 4.1.8 still.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 9, 2015

Juergen Hoeller commented

Addressed in 4.2.2 through a larger refactoring towards the new AbstractValueAdaptingCache base class. To be backported to 4.1.8 in a minimal form, just adding readResolve() declarations.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: backported type: bug
Projects
None yet
Development

No branches or pull requests

2 participants