Hello!

You can't call rawReader() from both superclass and extending class. You
need to program around it.

Regards,
-- 
Ilya Kasnacheev


чт, 3 окт. 2019 г. в 09:43, Sam C <[email protected]>:

> Hello,
>
> I am facing "org.apache.ignite.binary.BinaryObjectException: Method
> "rawReader" can be called only once." when tried to use raw mode.
>
> I have a super class and few extending classes, both are implementing
> Binarylizable. In readBinary method of extending class calling
> "super.readBinary(binaryReader)" which seems to cause the issue
> because binaryReader.rawReader() is called once in extending class and
> one more time in super class. To resolve I am having refactoring in
> super class by adding public method with BinaryRawReader parameter, Is
> there a better way to achieve rawmode for extending class?
>
> Super Class -
> public void writeBinary(BinaryWriter binaryWriter) throws
> BinaryObjectException {
>         BinaryRawWriter writer = binaryWriter.rawWriter();
>         writer.writeLong(id);
> ...
> ...
> ...
> }
>
> public void readBinary(BinaryReader binaryReader) throws
> BinaryObjectException {
>         BinaryRawReader reader = binaryReader.rawReader();
>         id=reader.readLong();
> ...
> ...
> ...
> }
>
> Extending class -
> public void writeBinary(BinaryWriter binaryWriter) throws
> BinaryObjectException {
>         super.writeBinary(binaryWriter);
>         BinaryRawWriter writer = binaryWriter.rawWriter();
>         writer.writeLong(subId);
> ...
> ...
> ...
> }
>
> public void readBinary(BinaryReader binaryReader) throws
> BinaryObjectException {
>         super.readBinary(binaryReader);
>         BinaryRawReader reader = binaryReader.rawReader();
>         subId = reader.readLong();
> ...
> ...
> ...
> }
>
> I am Using Ignite 2.7
>
> Thanks,
> -Sam
>

Reply via email to