We have an orm model which has a big int column, like
property name="offerId" column="offNo" ormtype="long" sqltype="bigint" default=0;
The number in the database is: 136343001448919149
If I do an entityload the number becomes: 136343001448919152
Looks for me like a bug?!
We are running the latest Lucee on Win and Linux with current stable orm: 3.5.5.77
I tried the beta release of the Hibernate ORM extension 5.4.29, the results are the same.
This is not a bug in ORM. There is an issue with handling large digit numbers in lucee (the related issue in Jira https://luceeserver.atlassian.net/browse/LDEV-3662).
TryCF.com
@cfmitrah Does it apply to large int as well? Long/Bingint are Integer.
Any ideas why this happens? This is the exact change of value I see with the Orm object
<cfscript>
writeoutput('int works fine');
dump(2147483646);
dump(javacast('int',2147483646));
writeoutput('long doesn''t<br>');
writeoutput('number should be: 136343001448919149');
dump(javacast('long','136343001448919149'));
dump(javacast('long',136343001448919149*100));
writedump(136343001448919149*100);
</cfscript>
So it looks that Lucee can’t handle long values correctly!