Thread: alternative to using a sequence

alternative to using a sequence

From
snacktime
Date:
I have an application that processes financial transactions.  Each of
these transactions needs to be sent with a sequence number.  It starts
at 1 and resets to 1 once it hits 8000.   I'm trying to think of the
most elegant solution without having to create a sequence for each
user (there are hundreds).  There is a table that holds the
configuration parameters for each merchant, so a field in that table
to hold the sequence number would be ideal.  In the past I've used
sequences as well as just a field which I query then update.  Any
other ideas?

Re: alternative to using a sequence

From
Jorge Godoy
Date:
snacktime <snacktime@gmail.com> writes:

> I have an application that processes financial transactions.  Each of
> these transactions needs to be sent with a sequence number.  It starts
> at 1 and resets to 1 once it hits 8000.   I'm trying to think of the
> most elegant solution without having to create a sequence for each
> user (there are hundreds).  There is a table that holds the
> configuration parameters for each merchant, so a field in that table
> to hold the sequence number would be ideal.  In the past I've used
> sequences as well as just a field which I query then update.  Any
> other ideas?

Take a look at http://www.varlena.com/GeneralBits/

There are some ideas there.  Of course, gapless sequences perform a bit worse
than sequences.  There was this discussion here on the ML last week as well,
so in the archives you'll find even more things to think.

--
Jorge Godoy      <jgodoy@gmail.com>

Re: alternative to using a sequence

From
"Merlin Moncure"
Date:
On 8/26/06, snacktime <snacktime@gmail.com> wrote:
> I have an application that processes financial transactions.  Each of
> these transactions needs to be sent with a sequence number.  It starts
> at 1 and resets to 1 once it hits 8000.   I'm trying to think of the
> most elegant solution without having to create a sequence for each
> user (there are hundreds).  There is a table that holds the
> configuration parameters for each merchant, so a field in that table
> to hold the sequence number would be ideal.  In the past I've used
> sequences as well as just a field which I query then update.  Any
> other ideas?

How many sequences are we talking about?

merlin