Hello, Normally, we create databases from CDTs and Datastores, and using au

Hello,
Normally, we create databases from CDTs and Datastores, and using auto generation for primary keys.

After using whichever application we develop which saves on that table, the primary key count reaches a certain number per say 20. At some point, we would like to drop all data and start clean, resetting the primary key counter back to 1.

To overcome this, we tried dropping and recreating the sequences, which seems to work well, but not for long, after resetting the counter 1, and using the system for a couple of days, we find a sudden jump, causing a non consistent primary key counter. e.g.1.2.3.4 then 21 instead of 5.

Please advise what else needs to be done to fully reset the counter to 1 causing a clean consistent primary key count 1.2.3.4.5...etc.

OriginalPostID-150883

OriginalPostID-150883

  Discussion posts and replies are publicly visible

Parents
  • Thanks for your answers, i am on an oracle DB, however my question is that even when i drop and recreate the sequence, it does start to count correctly from 1 followed by 2...etc, but then at some point it jumps to 21. skipping many numbers. I assume this is due to the caching mentioned above. Is there no way around this?

    Again, thanks a lot for all your answers.
Reply
  • Thanks for your answers, i am on an oracle DB, however my question is that even when i drop and recreate the sequence, it does start to count correctly from 1 followed by 2...etc, but then at some point it jumps to 21. skipping many numbers. I assume this is due to the caching mentioned above. Is there no way around this?

    Again, thanks a lot for all your answers.
Children
No Data