I would guess that your application is terminating with record stores still open. This can cause missing updates on Series 40s.
I recommend that you don't keep record stores open longer than the duration of one update, and that you open and close them within the same method invokation. If you reference RecordStore objects from non-local variables, you are likely to experience problems.
Methods that read or update a record store should look like these:
PHP Code:
public byte[] readRecord(int n) throws RecordStoreException {
byte[] data;
RecordStore rs = RecordStore.openRecordStore(RECORD_STORE_NAME, true);
try {
data = rs.getRecord(n);
} finally {
rs.closeRecordStore();
}
return data;
}
public void deleteRecord(int n) throws RecordStoreException {
RecordStore rs = RecordStore.openRecordStore(RECORD_STORE_NAME, true);
try {
rs.deleteRecord(n);
} finally {
rs.closeRecordStore();
}
}
This way, record stores are open for the shortest possible time, and they are always closed, even if something goes wrong.
Cheers,
Graham.