Skip to content

Transaction isolation #48

Answered by rhashimoto
steida asked this question in Q&A
May 11, 2022 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

SQLite calls the database VFS xLock/xUnlock methods at the beginning and end of each transaction (assuming you don't change the default locking mode), so it's up to you (you being the VFS author) to implement the locking mechanism. All the example IndexedDB classes use Web Locks for locking, which provides safe shared locking for read-only transactions and exclusive locking for read-write transactions. As long as (1) your browser supports Web Locks (quite recent for Safari, and I found a bug that they fixed but hasn't reached production yet) and (2) your critical SQL is within a transaction, isolation is satisfied.

Web Locks is the easiest (by far) way to implement locking, but not the on…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@steida
Comment options

@steida
Comment options

@rhashimoto
Comment options

@rhashimoto
Comment options

@rhashimoto
Comment options

Answer selected by steida
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants