Re: Sequences

From: Mitro Kivinen <nbs-mki_at_nbs.fi>
Date: 1996/08/05
Message-ID: <32058D86.2376_at_nbs.fi>#1/1


Thomas J. Kyte wrote:
>
> On Sat, 03 Aug 1996 19:41:19 -0700, Michael Wilson <mkwilson_at_well.com> wrote:
> >1. Just how lightweight are sequences? From what I've read, they seem to
> >provide a unique # for any number of requestors, without all the muss
> >and fuss of creating a counter in a row, and going through the overhead
> >of locking, etc; to maintain it. Right?
> Right. Sequences are non-blocking, multi-user, primary key generators in a
> manner of speaking.Warning....

Sequence is a bit dangerous if you are trying to use it as a candidate key generator for such applications that are needing a sequence that must not break! The next number is unique and given in the very time tha the new row is created (insert). If you decide to rollback the insertion, you will loose the current number. So you might find that you have a missing number.

Any way it is a good idea to create keys via sequences, not by hiding data into them!

Mitro Kivinen Received on Mon Aug 05 1996 - 00:00:00 CEST

Original text of this message