• 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: Error saving data to EO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error saving data to EO


  • Subject: Re: Error saving data to EO
  • From: Art Isbell <email@hidden>
  • Date: Mon, 11 Jul 2005 17:58:54 -1000

On Jul 11, 2005, at 5:39 PM, Chuck Hill wrote:

Primary keys must _never_ be updated. They are what EOF uses to uniquely identify the object.

Not to mention what happens to all of those to-one joins to the TechHelpSetup table in your DB after you've changed the primary key value; they all become dangling references to no row.


On Jul 11, 2005, at 8:20 PM, Don Lindsay wrote:

UsersWo, saving changes: cannot update primary-key 'registrati' from '200500' to '200501' on object:{values = {registrati = "200501"; rma = 0.0; tracking = 2.005E8; }; this = "<TechHelpSetup d3e679 _EOVectorKeyGlobalID[TechHelpSetup (java.lang.String)200500, (java.lang.Double)0.0,(java.lang.String) ,(java.lang.Double) 2.005E8]>"; } of entity: TechHelpSetup in databaseContext

Looks like TechHelpSetup has a 4-attribute primary key, two of which are doubles! Not all decimal doubles with fractional values can be represented exactly in binary. So depending on the rounding that the DB server and client must do, you could find that updates will fail unexpectedly because the comparison of the primary key values fails due to differences in rounding between the server and client. Stick with simple integer keys with no semantic value to your app or 24-byte binary keys that EOF can generate for you.


Aloha,
Art

_______________________________________________
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: 
 >Error saving data to EO (From: Don Lindsay <email@hidden>)
 >Re: Error saving data to EO (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Error saving data to EO
  • Next by Date: form post
  • Previous by thread: Re: Error saving data to EO
  • Next by thread: Re: Error saving data to EO
  • Index(es):
    • Date
    • Thread