> Michael Pikounis wrote:
> > I am looking for a good way to generate primary keys for my entities and I
> > was wondering if there is a "standard" way.
>
> I'm sure many people will immediately tell you to use database sequence
> tables, like Oracle's CREATE SEQUENCE construct.
>
> Personally, I don't like this approach (which puts me in a very small
> minority!). To me, the mechanics and logic used to generate an OID have
> nothing to do with the persistence layer, and consequently I like
> treating the generation of OIDs as a business logic function. See
> http://www.ambysoft.com/mappingObjects.pdf for a similar view.
I want to second Laird's reply. I have found that relying on a DB's
sequence generator is a certain portability issue. Further, by
controlling the sequencing with your own session bean, you can dish
up "blocks" of ID's, which allows your client to reduce the number of
times it needs to hit the server.
tim.
Tim Endres - [EMAIL PROTECTED]
ICE Engineering, Inc. - http://www.ice.com/
"USENET - a slow moving self parody." - Peter Honeyman
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".