I'll be using a SQLiteDatabase on an SD Card. Since this will not be
in the application's data area, I believe I will be using the
SQLIteDatabase static methods and not the SQliteOpenHelper to open
it.

I'll be having a single database open at one time, but I do expect
many threads to query it. Reads are frequent.
Writes are less frequent, except when a service is running a long
download process in the background.

What, in general, are the rules for accessing an SQLiteDatabase across
threads? I'm pretty sure there are some.

And which of these threading modes has Android compiled into the
SQLite binary?:

http://www.sqlite.org/threadsafe.html

Can and should one instance of SQLiteDatabase be created and shared
across threads?

Or should one SQLiteDatabase instance be created per thread, even
though all will point to the same database?

Should I expect my reading thread(s) to fail when a write is in
progress, or a writing thread to block when read(s) are in progress?

Since many details are somewhat hidden, is a read considered in
progress only for the duration of the query() method or for as long as
the cursor is being used?

Thanks for any tips. I'm willing to read a book, or chapter thereof,
if necessary.

Nathan



-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to