Subject | Re: [ib-support] Idea for a new field type for FB 2,0 or IB 7? |
---|---|
Author | Brad Pepers |
Post date | 2001-11-23T11:08:46Z |
On Friday 23 November 2001 03:28 am, Andreas Pohl wrote:
in my email. This is within transaction control and works perfectly in the
rollback situation.
getting the current value and incrementing it works fine. It is using the
fact that the database *has* to handle two users trying to update data at the
same time (part of the ACID requirements).
considerations above. I tested on a local machine with 10 copies of a
program that just created 1,000 invoices as fast as it could. When done I
verified that all the numbers were used and none skipped. I also tested with
some of the test programs doing rollbacks so that I could see if this was
working properly too. This *really* hammered the database. It was all local
access so no network speed issues and the load was huge. I'm very confident
that this code works properly.
--
Brad Pepers
brad@...
> Brad,There is a third way which is by using an id generation table like I outlined
>
> there are two possibilities to get next invoice number:
> - within transaction control by selecting max(nr)
> - outside transaction control by using generator value
in my email. This is within transaction control and works perfectly in the
rollback situation.
> Both ways will fail in case of rollback transaction. Generator value cannotUsing an id table doesn't fail when using rollbacks.
> be set back safely in a multi user environment.
> Max(nr) or next_ nr_procedure will provide different results if more thenUsing an id table and doing a dummy update first (to cause locking) and then
> one user is creating invoices and something goes wrong between calling
> trigger/statement for calculating invoice nr and closing transaction.
getting the current value and incrementing it works fine. It is using the
fact that the database *has* to handle two users trying to update data at the
same time (part of the ACID requirements).
> Maybe you are a lucky men and there is only a small time frame betweenNo its not luck - the design just works and you missed it in your
> posting values and closing transaction, but in WANs or slow LANs...
considerations above. I tested on a local machine with 10 copies of a
program that just created 1,000 invoices as fast as it could. When done I
verified that all the numbers were used and none skipped. I also tested with
some of the test programs doing rollbacks so that I could see if this was
working properly too. This *really* hammered the database. It was all local
access so no network speed issues and the load was huge. I'm very confident
that this code works properly.
--
Brad Pepers
brad@...