Replies: 2 comments 3 replies
-
I think the behavior you describe is working as expected. That's how exclusive locking works; it takes a lock and holds on to it:
Note that while this says that when the database is read a shared lock is held, the stock IDBBatchAtomicVFS doesn't use shared locking, i.e. only one connection can hold the lock at a time even if only reading. If you want to release the exclusive mode lock so another context can access the database, you have to either close the connection or change the mode and access the database:
|
Beta Was this translation helpful? Give feedback.
-
Thank you for your answer. If I understand it correctly, it means I have to implement some mechanism over wa-sqlite, if I want to use it with more than one tab. I have almost no idea, how that mechanism should work. Should I observe tab focus/blur? A simple example would be great. Meanwhile, if I will not use EXCLUSIVE mode, do I have to use WebLock? Probably yes. Then I don't understand the point of the whole async API, because, with custom WebLock, the sync version should be OK. Am I correct? Thank you for your work. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I just tested my app with two tabs open, and on the second tab, DB access is always somehow locked. When I don't use exclusive locking, my app works as expected. Is it possible I am doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions