Guys,
Take a look at this situation from a different view.
The following code snippet provided by Vladimir will guarantee that in
both cases "put" calls will store data in the binary format in a cache
(if BinaryMarshaller is used by default).
Cache c1 = ...;
c1.put(...);
Cache c2 = c1.withKeepBinary();
c2.put(...);
This guarantee sounds natural for me because I'm as a user don't want to
run into the situation when an entry is stored not in the binary format
just because I forgot to use "withKeepBinary()" at some point.
In my understanding the same approach should be implemented for the
storage as well. If "keepPortableInStore" is set to "true" then entries
are always stored in the binary format regardless on whether I used
"withKeepBinary()" or not.
I doubt that the user may want to keep data in the storage in both the
binary and non binary formats. So I don't see any reason why
"withKeepBinary()" is useful for the storage at all (the same as for
cache.puts).
--
Denis
On 12/10/2015 5:05 PM, Vladimir Ozerov wrote:
Alex,
What should happen if user do this?
Cache c1 = ...;
c1.put(...);
Cache c2 = c1.withKeepBinary();
c2.put(...);
10 дек. 2015 г. 17:02 пользователь "Alexey Goncharuk" <
[email protected]> написал:
Igniters,
We introduced a cache configuration property keepBinaryInStore which was
meant to determine the way persisted objects are passed to the store. This
flag overrides the value of withKeepBinary() projection flag, i.e. the
current behavior is:
withKeepBinary=false, keepBinaryInStore=false, store receives Deserialized
values
withKeepBinary=true, keepBinaryInStore=false, store receives Deserialized
values
withKeepBinary=false, keepBinaryInStore=true, store receives BinaryObjects
withKeepBinary=true, keepBinaryInStore=true, store receives BinaryObjects
However, from the -b1 user feedback it looks like this configuration
property and behavior is confusing. I think it makes sense to remove the
configuration property and rely solely on the projection flag, i.e.
withKeepBinary=false, store receives Deserialized values
withKeepBinary=true, store receives BinaryObjects
which is much simpler to understand.
Am I missing something?
--AG