Subject Re: [IBO] generator increments by 3
Author Helen Borrie
At 08:59 PM 30/12/2003 -0700, you wrote:
>Hi,
> Thanks for all the tips! They will be used for sure.
> However, I am still at a loss as to how the generator can increment by 3
>with a single call to the IBOQuery.

1. Prepare - increments it by 1. With a possible confusion of transaction
settings, I guess it is also possible that it's getting prepared twice. It
will get incremented each time it is prepared.
2. Open (set active) increments it again

That's why I suggested that you *don't* use this type of query to get the
value. It is a "fake query", since it doesn't act on a table. The
generation has to be timed so that it gets called once and only once, at
the right time. If you use GeneratorLinks, it will take care of that.

>It should only increment by 1. I have
>tried several different combinations of components and the result is always
>the same. This is not coincidence.

It is coincidence, insofar as you don't have the actual generation of the
number under control. The number will increment regardless of the client
transaction, because that is how generators are designed to work.

Something you can do for yourself is drop a monitor dialog onto your form
and actually watch each query that crosses the API - remembering that
*each* prepare and *each* open will cause the generator to fire.

>The only time it works is if you use the IBODatabase to control the
>transaction (and use the default trns) or to not explicitly do a
>transaction.

Let us see the DFM file. I want to see what your connection and dataset
objects think is the default transaction. If you would report on the
monitor activity, we can work out where the short-circuit is happening.

Helen