BaseIntegerIdEntity AutoIncrement Problem

I created baseIntegerId entities, thought of having id as integer primary key,
but when i try to add multiple entity instances getting primary key constraint violation error.
so tried to change the cuba.numberidcachesize property, worked for some time and if i go beyond to that size error occured again, now i changed the size to higher value, even though
getting same error.
can anyone please tell me how to handle sequences and auto increment and numberidCachesize property.
Thanks in advance.

Please provide more details: what CUBA framework version are you using, how do you create and persist entities.