• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Select on Double value during saveChanges
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Select on Double value during saveChanges


  • Subject: Re: Select on Double value during saveChanges
  • From: Markus Ruggiero <email@hidden>
  • Date: Sun, 02 Feb 2014 17:38:08 +0100


On 01.02.2014, at 16:32, Musall Maik <email@hidden> wrote:


Am 01.02.2014 um 14:19 schrieb Jeffrey Schmitz <email@hidden>:

Hello List,

   I have an operation that updates many attributes on about 150 rows of data in a TeamInfo table.  When doing a saveChanges operation it generates a SELECT statement like the one shown below for about 50 of the rows before it hits the one shown below that raises an exception.  All the previous SELECT's find a single row, but this particular one finds none.

The reason it's not finding a row is because of the value it's generating for finding a Double typed value.  For some reason it's using 72.60000000000001 but the value in the database is showing 72.6 (see bottom image).  I went through the debugger and stopped to the line where the value is set, and it is setting it to 72.6 (see image below).  

Sounds like some kind of nasty rounding/floating point representation problem going on so I'm wondering what I could do to guard against this?   

Switch to BigDecimal. Do not use floating point values with equality checks.


or remove the little lock from the column in Entity Modeler. This lock tells the framework to include the attribute in the where-clause.

---markus---


Markus Ruggiero
email@hidden
Check out the new book about Project Wonder and WebObjects on http://learningthewonders.com/







 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Select on Double value during saveChanges (From: Musall Maik <email@hidden>)

  • Prev by Date: Re: accentuated caracters in entity names: bad idea
  • Next by Date: Re: WOUnit testing with partial entities
  • Previous by thread: Re: Select on Double value during saveChanges
  • Next by thread: Re: accentuated caracters in entity names: bad idea
  • Index(es):
    • Date
    • Thread