[infinispan-issues] [JBoss JIRA] (ISPN-3471) storeAsBinary makes it near-impossible to use JdbcStringBasedCacheStore with non-standard key types
Krzysztof Sobolewski (JIRA)
issues at jboss.org
Wed Mar 23 06:58:00 EDT 2016
[ https://issues.jboss.org/browse/ISPN-3471?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Krzysztof Sobolewski closed ISPN-3471.
--------------------------------------
Resolution: Out of Date
I'm closing this as this was so many versions ago that it has been probably rewritten at least once :)
> storeAsBinary makes it near-impossible to use JdbcStringBasedCacheStore with non-standard key types
> ---------------------------------------------------------------------------------------------------
>
> Key: ISPN-3471
> URL: https://issues.jboss.org/browse/ISPN-3471
> Project: Infinispan
> Issue Type: Bug
> Components: Loaders and Stores
> Affects Versions: 5.3.0.Final
> Reporter: Krzysztof Sobolewski
>
> When storeAsBinary is enabled, there is a special MarshalledValueInterceptor inserted into the interceptor chain. This interceptor wraps the keys (and values) in MarshalledValue; this wrapper is then used in all interceptors as the actual key (or value). One of the interceptors that receives this wrapper is the CacheStoreInterceptor which indiscriminately passes it on to the configured CacheStore. The cache store is then supposed to store this wrapper for later retrieval.
> This works fine for cache stores that marshal the key (or value) as-is, without concern of its actual type. But there is this one very useful cache store, the JdbcStringBasedCacheStore, which is very concerned with the actual type of the key as it wants to be able to convert it to String and from String back again to the key type. When storeAsBinary is disabled, it works as designed; but when storeAsBinary is enabled, the actual key that the cache store receives may be the MarshalledValue wrapper which causes lot of confusion - the configured Key2StringMapper is not prepared to handle MarshalledValues; and even if it is, it cannot tell reliably whether it is supposed to wrap the key reconstructed from String (if it implements TwoWayKey2StringMapper).
> NOTE: this wrapping is, though, disabled if the key type is a "known" type - most notably primitives and String. That's why it's not a problem for majority of use cases where the key type is not non-standard.
> I strongly believe that [TwoWay]Key2StringMapper should never be concerned with MarshalledValues, and that JdbcStringBasedCacheStore should take upon itself the task of wrapping and unwrapping the keys as required.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the infinispan-issues
mailing list