#1 2015-08-08 09:27:58

JerryC_ph
Member
Registered: 2013-03-11
Posts: 16

JSTONToObject assigns a different ID

I have a JSON object created from ObjectToJSON in an interfaced-based service which returned in the content field of a TServiceCustomAnswer.

{
ID: 8201104080000,
Code: "",
LastName: "Cruz",
FirstName: "Emily",
MiddleName: "Grant",
Suffix: "",
BarCode: "8201104080000R",
CardNo: 0,
Programme: "IGNATIAN SPIRITUALITY & FORMATION OFFICE",
Section: "",
PatronType: "E-AA"
}

The client uses JSTONToObject to fill up a TSQLRecord Object.  However the ID is assigned to object is 2011511936 instead of 8201104080000.

Can someone tell me what is wrong?

Offline

#2 2015-08-08 11:42:12

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: JSTONToObject assigns a different ID

Which version of the source code are you using?

Offline

#3 2015-08-09 05:52:26

JerryC_ph
Member
Registered: 2013-03-11
Posts: 16

Re: JSTONToObject assigns a different ID

I downloaded the latest nightly build (1.18.1752) and still got the same result.  I'm using windows 8.1 and Delphi XE2.

Done some tests.  The maximum ID value that JSONToObject can handle properly is 2147483647 (i.e. the maximum value of an integer).  Seems that function GetInteger (line 22983 from SynCommons.pas and called from mORMot.pas line 42084) cannot handle values more than 2147483647.

Last edited by JerryC_ph (2015-08-09 07:03:30)

Offline

#4 2015-08-09 10:55:42

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: JSTONToObject assigns a different ID

Please try http://synopse.info/fossil/info/3f647350ba

Thanks for the feedback.

Offline

#5 2015-08-10 03:10:17

JerryC_ph
Member
Registered: 2013-03-11
Posts: 16

Re: JSTONToObject assigns a different ID

It's working as expected.

Thanks ab.

Offline

Board footer

Powered by FluxBB