-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Electron and Windows 11 #53
Comments
Hi, thanks for reporting this issue. Except for general advice, I cannot help much without a code example that reproduces the error, I'm afraid. One thing you have to make sure though is that you need to finalize all prepared statements. Calling In the library tests, I noticed that Windows (in contrast to macOS and Linux) is particularly picky about unfinalized statements. I don't know why. There is no Windows-specific code in Maybe that helps. If not, we really have to consider a code example, I guess. |
Hi, Thank you for more details - in fact we are using mainly We are also using Maybe you will have some more ideas. I will also try to prepare some simple example, but I afraid that there is some more complex case here as with the delete statements, which are perfectly working in simple case, but not working in my case inside the app |
Ok, finally I have found the issue :) The problem is with the When I have replaced my
All is working fine :) So I suppose that you should verify if the isOpen property works in all case. Unfortunately I cannot easily reproduce this issue on simple script - then |
Hi, thank you for all the details. To understand possible issues in the library better, I have two follow-up questions:
Thank you! |
Hi,
Maybe it is related somehow to used node.js version - electron uses v18, while my tests was on v16. I am quite busy this week, but if I will find time, I will also try to reproduce this issues in simpler electron app to exclude other side effects |
Hi,
First of all thank you for this library - we had serious issues with
better-sqlite3
on older linux machines and we have decided to use this one in Publii.Unfortunately we have discovered one important issue on Windows 11 - it seems that your library doesn't properly close the database connection. In result our app is unable to remove website folder while restoring website from backup - the db.sqlite file cannot be removed (even by
rimraf
). The EPERM error is returned. File is removed after closing the app so definitely it is connected with some unclosed handles to the db.sqlite file.The problem occurs only on Windows - we didn't observed it on mac OS or Linux. We have even tried to test it outside protected directories (on desktop) and with EV-signed app version, but the problem still occurs, so most probably it is not caused by Windows itself. Also app based on
better-sqlite3
properly closes the DB connection and there is no issue with removingdb.sqlite
file.I have even tried to create a custom build and use
close()
instead ofclose_v2()
as I have seen that better-sqlite3 usesclose()
, but without success, so there must be some additional operations to do during closing the connection with DB.The text was updated successfully, but these errors were encountered: