Search code examples
java-merecordstore

J2ME Record Store delete then insert Exception


I am working on J2ME Record Stores and when i delete the contents successfully, and then i check it, it gives me the correct count which is zero. But when i insert again, it gives me error finding record exception, because it is inserting after the content that i had inserted before. It is inserting from 2 instead of 1.

Can anyone explain why is it happening that way?


Solution

  • The record id in a recordstore is unique and auto-incrementing, just like a primary key in an SQL database. When 1 has been used, it cannot be used again. (Unless you delete the recordstore and create it again).