Ron Johnson <ron.l.johnson@cox.net> writes:
> Pre-allocate records. The (primary key?) field would have the
> numbers already filled in, but all the rest of the fields in each
> record be NULL, blanks, zeros or indicator values ("~~~~~~~~~~",
> -999999999, etc).
>
> Then create a single-field table called, for example, CUR_MAX_VALUE
> that gets incremented as part of each transaction. To serialize
> access, transactions would need an EXCLUSIVE lock on the table.
What's the difference to having just the table with the sequence where I make
an exclusive lock to get the value while inside the transaction? This
approach seems more complicated since I'd have to exclude records that match
the "not-used" pattern.
--
Jorge Godoy <jgodoy@gmail.com>