Subject Re: [IBO] Generator values not udpated
Author Helen Borrie
At 03:08 PM 7/11/2008, you wrote:
>> Right. Generators are running outside of transaction control.
>
>that's what I thought.
>
>> But you can decrement a generator value by using a negativ number
>> as increment. Perhaps this happens somewhere?
>
>nope. never even crossed my mind--nor would I let code like that even
>be played with in my main application. (Anything of that nature get's
>done outside of the application, in testing apps).
>
>> Although, that the numbers in the tables are correct, but the
>> generator values are not, sounds weird, except you are fiddling
>> around with decrementing generators, perhaps by accident.
>
>it's really strange because the import utility that the person was
>using imports data into 4 different tables. All 4 tables had problems
>with their generators being reverted to what it looked like they had
>been prior to the import.
>
>This is the second time in a year I've seen this--happened to someone
>elses database. Have thousands of users, probably 10-20 users who use
>the import utility on a somewhat regular basis.

Hmmm, Ed, you need to clarify what the actual problem is that's being observed:

Is it:
a) the import utility seems to change (or not to change) the current value of the *generator* ?

or

b) the imported records are getting stored with their "generatED IDs" as they were in the database they were imported from ?

or

c) something different to either, e.g. apparently sometimes one, sometimes the other...

For c), do you have a trigger that would cause this in a situation where the INSERT statement was going through as null, e.g.

if (new.id is null) then
new.id = gen_id(TheSameGenerator,1);

..thus risking a collision with numbers that were generated in a different database...?

Helen