Re: Globally unique IDs
Re: Globally unique IDs
- Subject: Re: Globally unique IDs
- From: Pierre Frisch <email@hidden>
- Date: Sat, 7 Feb 2004 17:11:26 -0800
On Feb 7, 2004, at 14:46, Ben Trumbull wrote:
> At 13:45 -0500 2/6/04, Colin O'Brien wrote:
>> It seems the automatic private key mechanism in WO only provides
>> unique keys
>> within a single database.
>
> Yes and no. EOF can only support an Entity mapping to a single
> database at a time. So the Table+rowPK is unique within a scope
> beyond a single database (all apps using that Entity's model; glossing
> over entity inheritance).
>
> It's not uncommon practice to manipulate the models, connection
> dictionaries, model groups, and EOF stacks (EOObjectStoreCoordinators)
> at runtime. So, indeed, it's not difficult to create a situation
> where the PKs are no longer unique with multiple databases even within
> one app.
>
Could you elaborate on the uniqueness. If I am not mistaken the 24
bytes is build as follow:
_hostAddress = ""; // 12 Char
_processIdentifier = "00000000"; // 8 Char
_counter = 0; // 4 Char
_timestamp = (new Date()).getTime(); // 16 Char
_random = new Random(_timestamp); // 8 Char
The timestamp is defined as milliseconds I do not see how you could get
two objects with the same ID.
Pierre
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.