On 1/14/2014 2:41 AM, Reza Housseini wrote:
But now it seems that not every interaction is logged into the database (I
also log the data in a std container). As I understand with the
serialization option multiple threads can have access to the same database
connection and statement, and sqlite will sort out any data races and dead
locks.

There can't be any data races or deadlocks to sort out when you only have a single connection. Within a single connection, SQLite simply serializes all API calls on a mutex. It doesn't matter if a single tread executes two BEGIN statements in a row, or two threads execute one each (on the same connection): the second statement will fail. It doesn't matter if a single thread calls sqlite3_step on an INSERT statement twice in a row, or two threads execute one each (on the same statement handle): the second call has no effect (without an intervening sqlite3_reset).
--
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to