tndrle / node-sqlite3-wasm

WebAssembly port of SQLite3 for Node.js with file system access
MIT License
63 stars 9 forks source link

Issue with Dropbox sync? #56

Closed dziudek closed 9 months ago

dziudek commented 9 months ago

Hi,

We have got another report about issue which didn't happen while using better-sqlite3 native module in our Electron app.

User reports that he gets often the following error:

A JavaScript error occurred in the main process
Uncaught Exception:
SQlite3Error: database is locked
at Database._handleError

It disappears when Dropbox synchronization is disabled.

It is possible that your library is more sensitive for files locked by Dropbox sync process than native SQLite3 module?

tndrle commented 9 months ago

Hi,

It is possible that your library is more sensitive for files locked by Dropbox sync process than native SQLite3 module?

That might be true. Native SQLite (and hence also better-sqlite3, I guess) has different locking mechanisms for different platforms ("dot-file", advisory locking, ...). node-sqlite3-wasm's only locking mechanism is using a "dot-file" locking (a directory to be precise). This is platform independent. But maybe it is less reliable with Dropbox sync.

There has been a small discussion about file access/locking in #31

dziudek commented 9 months ago

Hi,

Thank you for your fast feedback. Finally we have decided to use better-sqlite3 on mac OS/Windows and your library on Linux, because only on Linux we hade issues with better-sqlite3 :)