[odb-users] ODB Crashed in a multi-threaded environment

Albert (Jinku) Gu albert.gu at ringcentral.com
Sun Jan 31 20:45:57 EST 2016


Hi guys,

According to these two links:

  *   http://www.codesynthesis.com/pipermail/odb-users/2011-June/000124.html
  *   http://www.codesynthesis.com/pipermail/odb-users/2014-November/002242.html

We can know that odb::database is thread safe. With the connection pool, ODB will assign different odd::sqlite::connection instance to different threads.

In our app, there are two threads with a shared odd::sqlite::database instance, one thread is responsible for writing and reading, the other one is for reading only. Each of them will apply a connection before executing a transaction.

Sometimes, these two threads will access the same table, maybe the same row in database. At this time, odb will crash. And the exception message is “transaction already in progress in this thread”.

Am I doing something wrong? How can I resolve this issue?

Any help will be appreciated!

Regards,
Albert




More information about the odb-users mailing list