[odb-users] Regarding Sqlite WAL model support in ODB

Steve Chen steve.chen at ringcentral.com
Tue Feb 2 08:11:39 EST 2016


Hi,

Our mobile application (iOS & Android)  is using the ODB, and in order to improve the performance of reading & writing data, we want to support “WAL” model,
per sqlite official document https://www.sqlite.org/wal.html,
"WAL provides more concurrency as readers do not block writers and a writer does not block readers. Reading and writing can proceed concurrently.”

We used following code:

m_db = std::shared_ptr<odb::sqlite::database>(new odb::sqlite::database(dbFile, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_WAL));;

But it seems does not work. If reader is trying to read data but writer is also writing some big data, then reader will get a “db operation timeout” exception.

Any suggestion? How to support WAL in ODB?





More information about the odb-users mailing list