I avoid doubles and floats like the plague. I always use BigDecimal. It's a 
pain too, but at least you don't have to worry about catastrophic cancellation 
and you can control rounding.

http://en.wikipedia.org/wiki/Loss_of_significance

On Jun 19, 2013, at 8:29 AM, James Cicenia wrote:

> 
> Looks like I had to unlock "doubleNumber" in my model.
> 
> thanks.
> 
> On Jun 19, 2013, at 9:59 AM, James Cicenia <[email protected]> wrote:
> 
>> Red herring... something else going on.
>> 
>> I have a rest direction action and do the following in the action:
>> 
>>              EOEditingContext ec = ERXEC.newEditingContext();
>> 
>>              Device device = getDevice(ec,hwid,ppAppKey);
>> 
>>              device.setLastReportedLongitude(new 
>> Double(json.get("lng").toString().replace("\"", "")));
>>              device.setLastReportedLatitude(new 
>> Double(json.get("lat").toString().replace("\"", "")));
>>              device.setDateModified(new DateTime());// I can remove this and 
>> it still fails.
>>              ec.saveChanges();
>> Thoughts?
>> 
>> 
>> On Wed, Jun 19, 2013 at 9:02 AM, James Cicenia <[email protected]> wrote:
>> I am getting an error:
>> Caused by: com.webobjects.eoaccess.EOGeneralAdaptorException: 
>> updateValuesInRowDescribedByQualifier -- 
>> er.extensions.jdbc.ERXJDBCAdaptor$Channel method failed to update row in 
>> database
>> 
>> 
>> Here is the SQL being generated:
>> 
>> UPDATE Device SET lastReportedLatitude = ?, lastReportedLongitude = ?, 
>> dateModified = ? WHERE (id = ? AND badge is NULL AND hwid = ? AND 
>> lastReportedLatitude = ? AND lastReportedLongitude = ? AND osGatewayID = ? 
>> AND ppAppKey = ? AND token = ? AND zoneID is NULL)" withBindings: 
>> 1:41.85897038322115(lastReportedLatitude), 
>> 2:-87.66461452477394(lastReportedLongitude), 
>> 3:2013-06-19T08:52:51.734-05:00(dateModified), 4:2(id), 
>> 5:"6C219B57-8184-4537-85CE-B4A33F78F91E"(hwid), 
>> 6:41.8588996399584(lastReportedLatitude), 
>> 7:-87.6646017842811(lastReportedLongitude), 8:0(osGatewayID), 
>> 9:"679DB-17774"(ppAppKey), 
>> 10:"63080abb26010101ee4c...34a91d9a62bdaf20440a"(token)>
>> 
>> Here is it converted to run :
>> 
>> This Fails:
>> 
>> UPDATE Device SET lastReportedLatitude = 41.85897038322115, 
>> lastReportedLongitude = -87.66461452477394, dateModified = 
>> 2013-06-19T08:52:51.734-05:00 WHERE (id = 2 AND badge is NULL AND hwid = 
>> "6C219B57-8184-4537-85CE-B4A33F78F91E" AND lastReportedLatitude = 
>> 41.8588996399584 AND lastReportedLongitude = -87.6646017842811 AND 
>> osGatewayID = 0 AND ppAppKey = "679DB-17774" AND token = 
>> "63080abb26010101ee4c...34a91d9a62bdaf20440a" AND zoneID is NULL);
>> 
>> However if I put quotes around dateModified it does update.
>> 
>> Am I  missing a setting?
>>  
>> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/ramseygurley%40gmail.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to