Subject | Maintaining proper generator values |
---|---|
Author | Doug Chamberlin |
Post date | 2003-11-11T16:40:07Z |
Maintaining generator values which do not conflict with existing field
values is better done in the client. What I do while my client application
is starting up is to query the max existing value and if the generator is
currently set below that then I reset it to max+1. This is done for every
table which uses a generated field value. I have a short table in the
database which lists tablename, fieldname, generatorname so the application
just loops through these and checks each one. Simple, easy, efficient, and
well worth it to avoid duplicate generated values.
values is better done in the client. What I do while my client application
is starting up is to query the max existing value and if the generator is
currently set below that then I reset it to max+1. This is done for every
table which uses a generated field value. I have a short table in the
database which lists tablename, fieldname, generatorname so the application
just loops through these and checks each one. Simple, easy, efficient, and
well worth it to avoid duplicate generated values.