Hi all,
I found problem related to CacheJdbcPojoStore. If try to load data, with
enabled binary marshaller,
error may occur. Problem in entryMappings (this map helps resolve stored
type when data loading).
If binary marshaller disable we just put entry with java type in this map,
if enable we put java type + binary type.
......
checkTypeConfiguration(cacheName, valKind, valType,
type.getValueFields());
entryMappings.put(keyTypeId, new EntryMapping(cacheName, dialect, type,
keyKind, valKind, sqlEscapeAll));
// Add one more binding to binary typeId for POJOs,
// because object could be passed to store in binary format.
if (binarySupported && keyKind == TypeKind.POJO) {
keyTypeId = typeIdForTypeName(TypeKind.BINARY, keyType);
valKind = valKind == TypeKind.POJO ? TypeKind.BINARY : valKind;
entryMappings.put(keyTypeId, new EntryMapping(cacheName, dialect,
type, TypeKind.BINARY, valKind, sqlEscapeAll));
}
.......
I think it is wrong, because after we use this map like iterator for load,
and final result dependent from which mapping will be first java or binary.
Collection<String> processedKeyTypes = new HashSet<>();
for (EntryMapping em : mappings.values()) {
String keyType = em.keyType();
if (processedKeyTypes.contains(keyType))
continue;
processedKeyTypes.add(keyType);
.....
I think we must add only binary mapping for user pojo if binary marshaller
enable.