here is my problemI have this code to make an autoincrement variable in oracle database:
CREATE TABLE Korisnici
(
id_korisnika number PRIMARY KEY
Specifying the SEQUENCE with NOCACHE will stop a session caching 20 numbers at a time and help.
create sequence test_seq
start with 1
increment by 1
NOCACHE;
However, if you're hoping for a completely contiguous sequence this is very difficult to achieve - numbers taken from the sequence are "lost" if (for example) an insert is rolled back.
Based on your comment, I wonder if you're forgetting to COMMIT?