Re: Stupidity or sequences?

From: Nuno Souto <dbvision_at_iinet.net.au>
Date: Sun, 14 Apr 2013 00:03:52 +1000
Message-ID: <516965C8.9050901_at_iinet.net.au>



Bingo! Basically, the idea is to use the INSERT to grab a gapless series and stash it away for later use, either by the original session or another that "cleans up" later if original fails for whatever reason. As in: grab a sequence of numbers to be used in serialising documents/cheques/invoices/whatever physical representation is needed. In a fashion that avoids serial loss if serializing session fails. Of course, just like you said: it's all about what the needs are. In most cases where gapless is not needed, a simple Oracle sequence will do the job nicely and without major convolutions.
-- 
Cheers
Nuno Souto
dbvision_at_iinet.net.au


On 13/04/2013 8:21 PM, Hans Forbrich wrote:

> On 12/04/2013 11:56 PM, Nuno Souto wrote:
>> One way I've seen is to generate them in a single INSERT into a
>> table_of_pending_cheques (topc) statement, using a sequence . This
>> guarantees the serial numbering and by committing after the INSERT,
> Which lifts at least part of the 'concurrency' issue, by placing the
> insert into a single session.
>
> The challenge is to define the requirements properly, to understand what
> is required - uniqueness or [gapless] serialization or ... - and code
> against that. :-)
>
>
-- http://www.freelists.org/webpage/oracle-l
Received on Sat Apr 13 2013 - 16:03:52 CEST

Original text of this message