You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Alexey Popov (JIRA)" <ji...@apache.org> on 2017/10/16 16:11:00 UTC

[jira] [Commented] (IGNITE-6627) .NET: cache deserialization fails with complex value type & enum

    [ https://issues.apache.org/jira/browse/IGNITE-6627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16206116#comment-16206116 ] 

Alexey Popov commented on IGNITE-6627:
--------------------------------------

There are 3 actual fixes here:
1. Type EnumEqualityComparer`1 serialization issue: its object type ObjectEqualityComparer`1 is not ISerializable and should not be serialized.
Some explanation could be found here http://dotnetstudio.blogspot.ru/2012/06/net-35-to-net-40-enum.html
2. HashSet and other generic collection deserialization issue for enum arrays: object array was not casted to enum array
3. EmptyObject serialization issues: typeid of such object were not passed to Grid (BinaryProcessor)

Several tests were added for all issues.

[~ptupitsyn] please review the changes

> .NET: cache deserialization fails with complex value type & enum
> ----------------------------------------------------------------
>
>                 Key: IGNITE-6627
>                 URL: https://issues.apache.org/jira/browse/IGNITE-6627
>             Project: Ignite
>          Issue Type: Bug
>          Components: platforms
>    Affects Versions: 2.2
>            Reporter: Alexey Popov
>            Assignee: Alexey Popov
>              Labels: .NET
>             Fix For: 2.4
>
>
> There is an deserialization issue with complex structure.
> Please see the sample code below:
> {noformat}
>     public enum SampleEnum : byte
>     {
>         One = 0,
>         Two = 1,
>         Three = 2
>     }
> {noformat}
> {noformat}
>                 var cache = ignite.GetOrCreateCache<string, Dictionary<SampleEnum, Dictionary<int, int>>>("mySampleCache");
>                 cache.Put("DictData", Dict);
>                 var result = cache.Get("DictData");                
> {noformat}
> var result = cache.Get("DictData"); fails with exception:
> {"The constructor to deserialize an object of type 'System.Collections.Generic.ObjectEqualityComparer`1[SampleProject.SampleEnum]' was not found."}
> If we change 
> Dictionary<SampleEnum, Dictionary<int, int>>
> to 
> Dictionary<int, Dictionary<int, int>>
> then everything works fine



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)