Ignite C#瘦客户端中的冲突字段ID错误

问题描述 投票:0回答:1

我正在尝试使用C#瘦客户端将实体存储在Ignite缓存中。我有以下情况

public class A
    {
        DateTime StartDate { get; set; }
    }

    public class B:A
    {
        DateTime StartDate { get; set; }
    }

[当我尝试将B类的实例对象存储在点火存储中时,它给了我以下错误。

IgniteThinClient.GetCache<Tkey, TValue>("CacheName")

它给我下面的错误

Apache.Ignite.Core.Binary.BinaryObjectException:'冲突的字段ID [type = B,field1 = StartDate,field2 = StartDate,fieldId = 104069929]'

类似问题的链接

https://issues.apache.org/jira/browse/IGNITE-8588

Apache Ignite 2.1: Getting a "Conflicting type IDs" error after upgrading from 2.0

如何关闭C#瘦客户端的二进制对象存储?这将有助于解决此问题吗?

c# ignite distributed-caching
1个回答
0
投票

请检查serialization上的文档。您可以尝试在B中实现IBinarizable,而仅编写您关心的字段(或将二者放在不同的名称下)。您的里程可能会有所不同。

© www.soinside.com 2019 - 2024. All rights reserved.