Re: Suppressing reflective serialisation in Ignite

2018-11-26 Thread Pavel Tupitsyn
P.S. I realize that this is a major limitation.Ticket filed: https://issues.apache.org/jira/browse/IGNITE-10411 On Mon, Nov 26, 2018 at 7:54 PM Pavel Tupitsyn wrote: > Yes, there is a mismatch there, Ignite passes uninitialized object to the > serializer in order to handle reference loops. > >

Re: Suppressing reflective serialisation in Ignite

2018-11-26 Thread Pavel Tupitsyn
Yes, there is a mismatch there, Ignite passes uninitialized object to the serializer in order to handle reference loops. I think the easiest workaround is to use some library like DeepClone [1]: public void ReadBinary(object obj, IBinaryReader reader) { if (obj is IBinarizable bin) {

Re: Suppressing reflective serialisation in Ignite

2018-11-24 Thread Raymond Wilson
Yes, I want to throw exceptions essentially for all application types. Things like ephemeral exceptions I don't need serialization control over. Writing the object seems simple enough as you have suggested. However, reading it back is less simple due to the way IBinarySerializer calls ReadBinary

Re: Suppressing reflective serialisation in Ignite

2018-11-23 Thread Pavel Tupitsyn
Sorry, I'm wrong. You can of course just call writer.WriteObject(..) as a fallback, no need for BinaryFormatter. Your only goal is to throw exception for *some* types, right? On Fri, Nov 23, 2018 at 8:37 PM Pavel Tupitsyn wrote: > Hi Raymond, > > Exceptions implement ISerializable, and are

Re: Suppressing reflective serialisation in Ignite

2018-11-23 Thread Pavel Tupitsyn
Hi Raymond, Exceptions implement ISerializable, and are serialized that way in Ignite. However, there is no "fallback" mechanism that you ask about (I should file a ticket, this is a good catch). So the workaround is to use .NET BinaryFormatter to serialize non-IBInarizable types and write them

Re: Suppressing reflective serialisation in Ignite

2018-11-22 Thread Raymond Wilson
Hi Pavel, I have been using your suggestion with good effect. Thank you again for suggesting it. I just ran into a case where an exception was thrown that stated System.AggregateException could not be serialised within this class. While the BinarizableSerializer is good an ensuring all our

Re: Suppressing reflective serialisation in Ignite

2018-11-12 Thread Raymond Wilson
Thanks Pavel - works well! :) Raymond. On Tue, Nov 13, 2018 at 9:20 AM Pavel Tupitsyn wrote: > Hi Raymond, > > Yes, you can do that by implementing IBinarySerializer like this: > > class BinarizableSerializer : IBinarySerializer > { > public void WriteBinary(object obj, IBinaryWriter

Re: Suppressing reflective serialisation in Ignite

2018-11-12 Thread Pavel Tupitsyn
Hi Raymond, Yes, you can do that by implementing IBinarySerializer like this: class BinarizableSerializer : IBinarySerializer { public void WriteBinary(object obj, IBinaryWriter writer) { if (obj is IBinarizable bin) { bin.WriteBinary(writer); }

Re: Suppressing reflective serialisation in Ignite

2018-11-08 Thread Raymond Wilson
Hi Denis, Yes, I understand reflective serialisation uses binarizable serialisation under the hood (and it's fast and easy to use). But it has issues in the face of schema changes so it is better (and recommended in the Ignite docs) to use Binarizable serialization for production. I want to make

Re: Suppressing reflective serialisation in Ignite

2018-11-07 Thread Denis Magda
Hi Raymond, If to believe this page, the reflective serialization converts an object to the binary format (sort of marked with IBaniralizable interface implicitly): https://apacheignite-net.readme.io/docs/serialization#section-ignite-reflective-serialization -- Denis On Tue, Nov 6, 2018 at

Suppressing reflective serialisation in Ignite

2018-11-06 Thread Raymond Wilson
We are currently converting our use of Ignite reflective serialisation to use IBinarizable based serialisation [using Ignite 2.6 with c# client] What I would like to do is enforce a policy of not using reflective serialisation to ensure we have all the bases covered. Is there a way to do this in