[odb-users] ODB Crashed in a multi-threaded environment
Albert (Jinku) Gu
albert.gu at ringcentral.com
Thu Feb 4 06:24:22 EST 2016
Hi Boris,
Thank you for your detailed instruction.
Will try it.
Regards,
Albert
> On Feb 4, 2016, at 5:44 PM, Boris Kolpackov <boris at codesynthesis.com> wrote:
>
> Hi Albert,
>
> Albert (Jinku) Gu <albert.gu at ringcentral.com> writes:
>
>> Or, is there any detailed steps/guidelines to say how we can support
>> concurrency with ODB?
>
> With SQLite, it boils down to two things:
>
> 1. Make sure that you build SQLite with -DSQLITE_ENABLE_UNLOCK_NOTIFY=1
>
> See, for example, this Android guide:
>
> http://wiki.codesynthesis.com/Using_ODB_on_Android
>
> Also, when building libodb-sqlite, watch out for messages at the end
> of the ./configure output -- it warns you if the unlock notification
> is not supported by the SQLite build that you are using.
>
> 2. Follow the multi-threading guidelines outlined in the ODB manual.
> Specifically, don't share connections (or worse, transactions)
> between threads. Only share the database and let its connecton pool
> hand out a connecion to each thread.
>
> Also note that SQLite concurrency is generally quite poor, especially
> for write-heavy applications.
>
> Boris
More information about the odb-users
mailing list