Matt (preinvent) wrote: > To discount any possibility of concurrency problems I've synchronized > the static getInstance on my singleton and every function that calls > the DB (be it read or write). Makes no different though... it just > wiped it all again.
1. Have you been getting reports of problems from Nexus One owners? In other words, is this a DROID/Milestone thing or a 2.0+ thing? 2. Are you writing other local files directly (e.g., using File objects and java.io)? Are you sure you're not clobbering your files yourself by accident? 3. Since you mentioned rooting the phone and looking at directories, I assume these files are stored on the built-in flash, not the SD card -- right? That would eliminate Mr. Thomas' comments regarding FAT, because the on-board flash is not FAT. > It must be a filesystem problem (delayed writes?), or something buggy > in the underlying sqlite code. Can't be the latter, as that would not affect SharedPreferences. > I'll gather all the info when I have time.. right now I just need to > find a working way of storing data - 65k+ angry users to appease! That probably won't help. Your reported symptoms indicate that multiple file types (SQLite databases and shared preference XML files) are being harmed. You could switch from SQLite to JSON files, and those will may well get trashed too. If you can get a database in the "database disk image is malformed" state, we can examine it to figure out how it is damaged: -- data OK but checksum wrong? -- random bits of the file have invalid data (e.g., your delayed writes concept) -- the whole file was replaced by a PNG image that you downloaded and saved to the wrong file by accident -- something else Similarly, if you do elect to switch to some other form of storage, and that starts failing (e.g., JSON parse() exceptions), we can look at those files and see what exactly is going on. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android App Developer Training: http://commonsware.com/training -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.