Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Re[3]: How do you generate primary keys?
I think this is a high-level design and even analysis issue in many cases.
If no gaps are allowed, you probably should allocate a key value for any
record just before committing the transaction (commiting has wider meaning
here, e.g. accepting or permanently storing). That way you won't get
problems with rollbacks, but of course in some environments you have to know
your keys ID before you commit or IDs should be allocated based on
transaction start time etc. In these cases you have to do some kind of
tradeoff between performance and key "quality" and these kind of decisions
should be done as early as possible, in analysis/design stage.
Tanel.
> Wednesday, November 5, 2003, 1:14:26 PM, Jamadagni, Rajendra
(Rajendra.Jamadagni_at_espn.com) wrote:
> JR> hypothetically, When you have a requirement that no gaps allowed in a
sequence no matter what,
> JR> would you still use sequences?
>
> Ah! This is a good question. If no gaps are acceptable,
> period, end of story, then what is a viable solution? I do
> not think sequences are it.
>
> Best regards,
>
> Jonathan Gennick --- Brighten the corner where you are
> http://Gennick.com * 906.387.1698 * mailto:jonathan@gennick.com
>
> Join the Oracle-article list and receive one
> article on Oracle technologies per month by
> email. To join, visit
http://four.pairlist.net/mailman/listinfo/oracle-article,
> or send email to Oracle-article-request_at_gennick.com and
> include the word "subscribe" in either the subject or body.
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Jonathan Gennick
> INET: jonathan_at_gennick.com
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Tanel Poder INET: tanel.poder.003_at_mail.ee Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Sun Nov 09 2003 - 17:24:25 CST
![]() |
![]() |