• 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: PK uniqueness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PK uniqueness


  • Subject: Re: PK uniqueness
  • From: Jesse Tayler via Webobjects-dev <email@hidden>
  • Date: Mon, 15 Sep 2025 11:37:58 -0400

In memory you will have a temporary ID and it doesn’t seem possible to
interfere or duplicate in any practical sense, it’s local.

Once stored in the DB it will have a key, which is generally tied to a
“by-hand” method of generation, but I think everyone accepts that who uses EOF
and I don’t seem to mind.

Keys have locking and can come into memory in a batch to better ensure a save
without repeating, but even then I’m pretty sure a DB unique failure will only
result in fetch/save of a new key (integer) that is controlled by the DB.

In short, no, you should not have to worry about that.

> On Sep 15, 2025, at 11:09 AM, OCsite via Webobjects-dev
> <email@hidden> wrote:
>
> Hi there,
>
> presumed I use integer PKs and don't ever assign them myself, leaving it on
> EOF, can I rely on that never a newly created EO would get same PK as used to
> have one deleted previously? Or is there some rare scenario when this may
> happen?
>
> I need to store some information for EOs (which would be very rarely deleted,
> but occasionally it might happen) in a map whose keys would be the PKs (the
> map itself persists archived in a BLOB of another EO). I wonder whether I
> have to observe deletions and update these maps accordingly, or whether I can
> afford to simply keep PKs and information for deleted EOs in there without
> any real harm.
>
> Thanks!
> OC
> _______________________________________________
> 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

 _______________________________________________
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: 
 >PK uniqueness (From: OCsite via Webobjects-dev <email@hidden>)

  • Prev by Date: PK uniqueness
  • Next by Date: Re: PK uniqueness
  • Previous by thread: PK uniqueness
  • Next by thread: Re: PK uniqueness
  • Index(es):
    • Date
    • Thread