So I haven't been following this thread very closely so apologies in
advance if you've already
been over this.
The SQLite thing kind of has the stench about it like there are possibly
multiple writers. AFAIK,
SQLite is very single threaded and multiple writers is a big no-no. So
let me toss something out
that I just noticed about the app lifecycle: it seems that there is the
possibility that you can have
multiple running versions of the same app. This seems to be especially
true when you have the
screen orientation follow-me switch on. If you're doing some finish up
db io on the old orientation,
and the new orientation fires up, you might be setting yourself up for a
collision. There are other
ways that this can happen, but the orientation follow-me switch seems to
really up the likelihood
by exercising that window a lot more.
Mike
Mark Murphy wrote:
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.
--
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.