• 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: assigning primary key on insertion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: assigning primary key on insertion


  • Subject: Re: assigning primary key on insertion
  • From: Deirdre Saoirse Moen <email@hidden>
  • Date: Tue, 20 May 2003 15:04:04 -0700

On Tuesday, May 20, 2003, at 11:05  AM, Jonathan Rochkind wrote:

I'm interested in generating the pk upon insertObject, when it's still uncommitted, but in fact still using the usual way of generating them... oh wait, now I see. You can call primaryKeyDictionary(false) to have the EO generate a pk in advance, and then the db context delegate will use that pk when it's finally committed. Interesting. This won't change the EOGlobalID for the object though, right? The EO will still have a temporary globalID until it is committed, even though the EO itself 'knows' it's eventual permanent pks. Am I following? Thanks.

You may not care about this, but I've seen it create more than one fracas, so I'll point out the potential downside of this: assigning the primary key in advance inherently means there will be holes in primary key sequence numbers. Now, usually, that's not an issue, but if one of your primary keys is, say, "invoice number" and someone suddenly wonders why one record is "missing," it can create a lot of extra work.


--
_Deirdre http://deirdre.net
"Cannot run out of time. There is infinite time. You are finite. Zathras is finite. This....is wrong tool." -- Zathras
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: assigning primary key on insertion
      • From: email@hidden (Anjo Krank)
  • Prev by Date: Re: assigning primary key on insertion
  • Next by Date: Re: assigning primary key on insertion
  • Previous by thread: Re: assigning primary key on insertion
  • Next by thread: Re: assigning primary key on insertion
  • Index(es):
    • Date
    • Thread