[ https://issues.apache.org/jira/browse/IGNITE-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14970805#comment-14970805 ]
ASF GitHub Bot commented on IGNITE-1644: ---------------------------------------- GitHub user ptupitsyn opened a pull request: https://github.com/apache/ignite/pull/173 IGNITE-1644 .Net: DateTime.Kind is lost during serialization You can merge this pull request into a Git repository by running: $ git pull https://github.com/ptupitsyn/ignite ignite-1644 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/173.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #173 ---- commit a2ba025271ecbaa656aaa7d6028db49b62f494c7 Author: Pavel Tupitsyn <ptupit...@gridgain.com> Date: 2015-10-23T09:54:44Z wip commit bbd3fe83dd039348304132d47f77c34c4ccc0833 Author: Pavel Tupitsyn <ptupit...@gridgain.com> Date: 2015-10-23T09:59:38Z wip commit 1045c7db652166864b47aa525ee77a81a521e488 Author: Pavel Tupitsyn <ptupit...@gridgain.com> Date: 2015-10-23T10:00:07Z wip commit 364a71dc1a5d48c19c10cd9ece76c278b364552a Author: Pavel Tupitsyn <ptupit...@gridgain.com> Date: 2015-10-23T10:07:36Z Move serializable to handlers commit 53a6635c33a7cf24c858aa602763f8af59170b29 Author: Pavel Tupitsyn <ptupit...@gridgain.com> Date: 2015-10-23T10:23:12Z wip tests commit 0580580fa05b9e806dae925629d72a6c4b8be7fe Author: Pavel Tupitsyn <ptupit...@gridgain.com> Date: 2015-10-23T10:24:37Z wip commit dc348d1629fe152dafcb3f40bb7aec68960ca5e3 Author: Pavel Tupitsyn <ptupit...@gridgain.com> Date: 2015-10-23T10:33:26Z DateTimeHolder commit 05a5319a9509a405f4a47a31e94fa45bb7a3bc8f Author: Pavel Tupitsyn <ptupit...@gridgain.com> Date: 2015-10-23T10:36:27Z TypeDateTimeHolder commit 1dea88a903fd76f71d4ba22a7c00bd76219dc566 Author: Pavel Tupitsyn <ptupit...@gridgain.com> Date: 2015-10-23T10:42:28Z wip commit 3af414cd255ab1f2d0c70dbb4c0a74240d08c09b Author: Pavel Tupitsyn <ptupit...@gridgain.com> Date: 2015-10-23T10:48:06Z Fix DateTime arrays ---- > .Net: DateTime.Kind is lost during serialization > ------------------------------------------------ > > Key: IGNITE-1644 > URL: https://issues.apache.org/jira/browse/IGNITE-1644 > Project: Ignite > Issue Type: Bug > Components: interop > Affects Versions: 1.5 > Reporter: Pavel Tupitsyn > Assignee: Pavel Tupitsyn > Fix For: 1.5 > > > Add the following test to PortableSelfTest.cs: > {code} > [Test] > public void TestWriteDate() > { > DateTime time = DateTime.Now; > DateTime timeUtc = DateTime.UtcNow; > Assert.AreEqual(_marsh.Unmarshal<DateTime>(_marsh.Marshal(time)), time); > Assert.AreEqual(_marsh.Unmarshal<DateTime>(_marsh.Marshal(timeUtc)), > timeUtc); > } > {code} > Observe that it fails becuase we loose DateTimeKind. > This happens because we always write DateTime as UTC and lose DateTime.Kind, > so on deserialization we do not know whether ToLocal should be called. > DateTime must be serialized in portable form only in two cases: > 1) IPortableWriter.WriteDate() > 2) IPortableWriter.WriteDateArray() > In these cases we should throw exception on a non-UTC date. > In all other cases it should be serialized in some other form. E.g., we can > introduce new wrapper type ".NET-specific" and wrap DateTime, Collections, > Arrays (IGNITE-1779) in it. > This will break queries to some extent. -- This message was sent by Atlassian JIRA (v6.3.4#6332)