Description
Discovered in course of working on IGNITE-4340.
Say, we have following type for cache values
static final class AllTypes implements Serializable { /** * Data Long. */ @QuerySqlField Long longCol; /** * Inner type object. */ @QuerySqlField InnerType innerTypeCol; /** */ static final class InnerType implements Serializable { /** */ @QuerySqlField Long innerLongCol; /** */ @QuerySqlField String innerStrCol; } }
Queries like this fail for both optimized and binary marshaller:
UPDATE AllTypes set innerLongCol = ?
For optimized, current DML implementation mutates existing inner property thus confusing DML statements re-run logic (query re-runs because engine sees value as concurrently modified, though the only change is its own, and ultimately fails). The solution is to clone inner objects and set new property values on them because we need to have old value pristine.
For binary, current DML implementation does not honor properties hierarchy and, for above example, just sets innerLongCol field on AllTypes binary object and not its child InnerType object. Thus, index will be updated and SELECTs for that column will return correct value for that field, but inner state of target property innerTypeCol does not change, and AllTypes object gets its own odd field innerLongCol which it does not know how to do with (no metadata about it in type descriptor).
The patch for both problems is ready and lying on my shelf waiting for 1.8 release to happen to be applied. Then this will ultimately be fixed with the rest of known problems/improvements (Jira issues for them will follow).
Attachments
Issue Links
- blocks
-
IGNITE-4669 .NET: Sort binary object fields
- Resolved
- relates to
-
IGNITE-10824 SQL: mixing _key and key columns in the DML queries must be disallowed
- Resolved