You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[...] sqlite_orm is doing some thread-unsafe calls that it doesn't have to do, and could definitely use some improvement in this area. For example, there is lots of code that looks like this:
which isn't thread safe because there's a race condition between the sqlite3_step(stmt) and the sqlite3_errcode(db)/sqlite3_errmsg(db) calls, which means the code and message in the exception aren't reliable when used multithreaded.
If I was writing it using raw libsqlite3, then I would write it to be thread-safe by writing it as:
auto rc = sqlite3_step(stmt);
if (rc == SQLITE_DONE) {
// done..
} else {
throwstd::system_error(std::error_code(rc, get_sqlite_error_category()), sqlite3_errstr(rc));
}
but I can't currently get that thread safety with sqlite_orm.
Originally posted by @jagerman in #707
The text was updated successfully, but these errors were encountered: