Re: Incremental value in a field [forms 6i]

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 17 Oct 2001 13:04:47 +0200
Message-ID: <tsqpqfiid3l450_at_corp.supernews.com>


[Quoted] You can create the sequence with the nocache option. Other than that the existence of gaps in a sequence can IMO not be considered as a disaster, as sequence numbers are used as *meaningless* id's anyway

Duplicate values shouldn't occur if you select the max value for update of the id, so the table is locked when you calculate the new max. Compared to sequences though this is a very inefficient solution.

Regards,

Sybrand Bakker
Senior Oracle DBA

"Diego Maninetti" <mdiego_at_iname.com> wrote in message news:da2ebe22.0110170254.2493dcf4_at_posting.google.com...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi everibody.
>
> I have a little problem in a form 6i application.
> I need to generate an incremental key for a table-based block.
>
> If I use a sequence, in case of rollback i get gaps between
> values; otherwise, if I use the max(id), there are duplicate
> keys in case of concurrency insert.
>
> I thought to manually update the id before commit, but during
> the post transaction the table is locked by oracle.
>
> Any ideas?
>
> Thank you and sorry for my terrible english :-)
>
> Bye
> Diego
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (MingW32) - WinPT 0.4.0
> Comment: For info see http://www.gnupg.org
>
> iD8DBQE7zWOKeYa3s6PoXAIRAmbEAJ9Nvd1T6aCkgXNEj7T9OkUzkdVXrQCeN00j
> YWkF2IZ0bE7e4z2wBVHElqw=
> =Iv/Y
> -----END PGP SIGNATURE-----
Received on Wed Oct 17 2001 - 13:04:47 CEST

Original text of this message