It doesn't entirely surprise me. What I suspect is: the application was not shutting down correctly, and keeping RMS open. This could result in RMS corruption when the device is power-cycled. However, what confuses me is that RMS was accessible after installing on top of the broken installation. Possibly, the RMS itself was not damaged, but some kind of information about it (locking information?) was. Perhaps this information gets reset when you re-install.
Are you keeping RMS open for long periods? If so, I strongly recommend against this. You may find that the problem re-appears if you power-cycle while running the app.
My recommended practice for RMS access is:
PHP Code:
RecordStore rs = RecordStore.openRecordStore(RECORD_STORE_NAME, true);
try {
// add / delete / update
} finally {
rs.closeRecordStore();
}
This keeps the record store open for the shortest possible time, and ensures that it is closed after use (even if an exception or error is thrown).
Some devices will always halt threads when the application exits. Some do not. It is always a good idea to make sure that all threads get stopped during the exit process. A thread can only be stopped by causing it's run() method to exit.
(Setting the variable that references the Thread object to null does not stop the thread. The garbage collector does not stop threads, close files, close RMS or close network connections.)
Cheers,
Graham.