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

CompleteConfiguration.isWriteThrough issues #406

Open
cruftex opened this issue Mar 7, 2019 · 0 comments
Open

CompleteConfiguration.isWriteThrough issues #406

cruftex opened this issue Mar 7, 2019 · 0 comments

Comments

@cruftex
Copy link
Member

cruftex commented Mar 7, 2019

The specified effect of CompleteConfiguration.isWriteThrough is not being tested via the TCK, and probably not really implemented like the spec says by caching providers.

In JCache its possible to define a loader that will be used in case of loadAll is invoked, and, in case readThrough is enabled the loader is invoked automatically in case a mapping is missing.

Consequently there is the possibility to define a writer and enable write through via CompleteConfiguration.isWriteThrough. However, there are actually no explicitly defined semantics for the case that the writer is defined but write through is not enabled.

In the cache2k JSR107 implementation I simply ignore the write through flag. That means that the TCK does not require write through to be enabled for the write through tests.

There is no test or defined behavior for the illegal configuration of write through being enabled but no writer defined. Checking the RI code I assume it crashes with NPE on Cache.put but does proceed normally on Cache.putAll.

Two options to mitigate this irritation:

  1. Deprecate and make clear that CompleteConfiguration.isWriteThrough has no effect and can be ignored and the write through is enabled via defining a writer.
  2. Improve the TCK and RI that isWriteThrough must be enabled, and add tests for the invalid configuration

I recommend doing 1, because option 2 would mean that implementations and applications have to change without any benefit.

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

No branches or pull requests

1 participant