Re: Non-integer primary keys
Re: Non-integer primary keys
- Subject: Re: Non-integer primary keys
- From: Steve Sharman <email@hidden>
- Date: Tue, 3 Aug 2004 00:28:30 +0100
Thanks for the reference Art - that's what I was looking for. And
you're right - what I'm thinking about doesn't make any sense from a
WebObjects viewpoint - I was mulling over various models for how a
distributed or mobile WO application might work from an object
synchronisation perspective.
What I was thinking was that if I could ensure that each separate
application (each with it's own application server and database) used
completely unique keys (e.g. there would be no possibility of a
"person" object on app server 1 having the same PK as another "person"
object on app server 2), then I could use the underlying database
middleware to keep the two databases and applications in sync. Not
going to work... but still, it's not something that I'm too worried
about at this point.
Thanks,
-- Steve
On 2 Aug 2004, at 20:23, Art Isbell wrote:
On Aug 2, 2004, at 12:01 AM, Steve Sharman wrote:
I'd like in the future to be able to implement a mechanism where I
can be absolutely sure that my primary keys are completely unique
across all instances of an application, even if those applications
are running on completely different database and application servers.
I must not be understanding your needs. Primary key values are
unique within a table in a database. The database guarantees
uniqueness. They have nothing to do with application instances or
where the app or database are running. All instances of an EO within
different editing contexts and in different app instances will have
the same primary key value, that which was fetched from the database.
This must remain true for EO caching to work correctly and for the
correct mapping of an EO to a database row.
I've seen a few references on the list to character primary keys, but
nothing much which is specific on implementation. Is there anywhere
on the web or in the development documentation that shows how this
might be done - presumably it's easy to set up the primary key for an
EO as being of character type, it's the PK generation mechanism that
I'd like to properly understand.
http://developer.apple.com/documentation/WebObjects/
Enterprise_Objects/Saving/chapter_8_section_5.html#//apple_ref/doc/
uid/TP30001011-DontLinkChapterID_14-TPXREF151 discusses the EOF hooks
that support custom primary key generation. But how to generate
unique primary key values is up to you.
Aloha,
Art
_______________________________________________
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.
_______________________________________________
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.