What is the default threading mode for SQLite in Android?

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

From the above link, I found out that SQLite supports three different stream modes: single-threaded, multi-threaded and serialized. I'm just curious to know: "What is the default threading mode for SQLite in Android"? is there any way to change threading mode pragmatically? If so, how and what benefits do I get? When to choose which one with some examples?

Thanks in advance.

+8
android sqlite sqlite3 sqliteopenhelper
source share
1 answer

The default mode is Serialized

By default, SqliteDatabase is a safe thread, you can check it in Android Docs,

setLockingEnabled(boolean lockingEnabled)

From Documents -

Determine if SQLiteDatabase is a safe thread using blocks critical sections. This is quite expensive, so if you know that your database will only be used by one thread, then you should set this to false. The default value is true.

+4
source share

All Articles