I am trying to use the api website database in webkit based browsers. I used async api in mostly ui thread and web worker . Both threads access the same database (which, as you know, is sqlite underthehood)
Everything behaves normally, but sometimes transactions are lost or one transaction fails, and this seems to be a time / race condition. Access to the sqlite database does not seem to be thread safe.
A bit more background. My web worker simply queries the table, which may have a record inserted into it from the main ui stream.
I am wondering, is it really documented with what secure access to local / web storage can be obtained from both the ui thread and the web worker thread? I read somewhere that indexeddb api is thread safe, but that doesn’t help me now, since browser support for it is bad / nonexistent for the browsers I am targeting (at least I think so - I get information from http: / /caniuse.com )
Any ideas would be greatly appreciated.
source share