Turns out that the commit hook is called before the page cache is flushed to VFS - so we can't really use it to do the commit.
Instead, in this PR a mechanism for pessimistic write locks is implemented. Exclusive transactions that are not mvcc_aware will acquire a lock. If there is already conflict at this stage, a database is locked error is returned. This is a best-effort behavior to match SQLite's standard behavior.
Turns out that the commit hook is called before the page cache is flushed to VFS - so we can't really use it to do the commit.
Instead, in this PR a mechanism for pessimistic write locks is implemented. Exclusive transactions that are not
mvcc_aware
will acquire a lock. If there is already conflict at this stage, adatabase is locked
error is returned. This is a best-effort behavior to match SQLite's standard behavior.Fixes https://github.com/losfair/mvsqlite/issues/2.