Subject | Generator not incrementing |
---|---|
Author | Ed Dressel |
Post date | 2011-08-12T22:31:20Z |
FB 1.56 embedded, IBO 4.9.9
My co musters have seen the symptoms of a FB generator not incrementing for years (throwing a primary key exception), I've just never been able to isolate it. Finally, I am seeing it.
I have a TIBODatabase (FIBConn) wit ht the following LOC:
result := FIBConn.Gen_ID('GEN_GROUP_ID', 1);
Now, when I run this code in my app, I can see it assigned a 3, then 4, then 5... If I stop my app and re-run it, it starts at 3 again, and this throws an exception.
AFAICR generators should always increase unless there is a serious system problem.
Has anyone else seen a problem like this? What can I do to avoid it?
Ed Dressel
My co musters have seen the symptoms of a FB generator not incrementing for years (throwing a primary key exception), I've just never been able to isolate it. Finally, I am seeing it.
I have a TIBODatabase (FIBConn) wit ht the following LOC:
result := FIBConn.Gen_ID('GEN_GROUP_ID', 1);
Now, when I run this code in my app, I can see it assigned a 3, then 4, then 5... If I stop my app and re-run it, it starts at 3 again, and this throws an exception.
AFAICR generators should always increase unless there is a serious system problem.
Has anyone else seen a problem like this? What can I do to avoid it?
Ed Dressel