Re: Key Creation & EO
Re: Key Creation & EO
- Subject: Re: Key Creation & EO
- From: Art Isbell <email@hidden>
- Date: Mon, 12 Jul 2004 12:07:03 -1000
On Jul 12, 2004, at 1:08 AM, Lotsa Cabo wrote:
On Jul 10, 2004, at 9:48 PM, Scott Keith wrote:
The database actually generates the key in this case (not the
framework/plugin). However, the plugin does send the NEWID command to
the server to generate the key. If you don't use the plugin then EO
sends a select statement to get the seed value in the EO_PK_TABLE, it
adds 1 to it, and then updates the table. That is the default
behavior which our plugin overrides.
Holy ___ ! Is this correct!?!?!
Sounds reasonable to me.
If the default logic within EO is this two-step process of
issuing a SELECT for the current ID and then incrementing the ID just
to return it, then what prevents another instance of the application
from using the same ID BEFORE the first one has an opportunity to get
inserted?
This is probably prevented by different means depending on the DB. I
suppose the primary key table could be locked, fetched, updated, and
unlocked to prevent concurrent access. I suppose this locking may not
be explicit if all operations are included within a single transaction.
Someone with a better understanding of low-level DB operations could
probably explain this better. Just be assured that this primary key
generation approach works correctly.
Also, Scott mentioned a plugin that overrides this. I've never heard
of any plugin mentioned anywhere... at least, not in any of the books
I've read. Where can one find such a plugin?
/Library/Frameworks/OpenBasePKPlugIn.framework
And, if OpenBase
provides the plugin, then what about all of the other databases out
there?
Plugins for some are available (e.g., FrontBasePlugIn.framework), for
others, not.
Talk to me, Goose.
Honk!
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.