You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/01/29 11:37:16 UTC

[GitHub] [ignite] ptupitsyn commented on a change in pull request #8724: IGNITE-13639 .NET: Fix detached semantics for array and collection elements

ptupitsyn commented on a change in pull request #8724:
URL: https://github.com/apache/ignite/pull/8724#discussion_r566761874



##########
File path: modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs
##########
@@ -1084,7 +1084,7 @@ public static void WriteArray(Array val, BinaryWriter ctx, int? elemTypeId = nul
             stream.WriteInt(val.Length);
 
             for (int i = 0; i < val.Length; i++)
-                ctx.Write(val.GetValue(i));
+                ctx.WriteObjectDetached(val.GetValue(i), parentCollection: val);

Review comment:
       `Write` supports circular references, so we can't write everything in detached mode.
   
   Yes, this feature introduces a lot of complexity, and possibly degrades performance due to handle tracking. Hopefully we'll get rid of this on 3.0, but for 2.x we have to maintain the compatibility.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org