Christian Kratzer <ck-lists@cksoft.de> writes:
> I would at least try to assign multiple such numbers in batches to mimize
> contention on the row you store the counter in.
What do you mean here? How would you guarantee that on of the receiver
transactions didn't rollback and left a gap in the "sequence"?
I believe that for invoices it is less problematic. At least here I don't
need the "time" part control, so if I leave one blank I can fill it later in
the same day without problems (except, of course, if the sequence number is
tied to some other physical evidence such as the paper counterpart of the
invoice and that is also chronologically assigned).
The whole problem appears because no matter how much we validate input and
relationships on the input interface, something might happen and make the
"INSERT" transaction fail. Theoretically, all should go fine, but... :-)
--
Jorge Godoy <jgodoy@gmail.com>