Ticket Change Details
Not logged in

Artifact ID: 8e85121821926ebd59fde505e5e7d0be136854ce
Ticket: 0b91277bb4e13c7c68bdbbb76558871ed5dd5c35
Add option for a process exclusive mode to open files on Windows
User & Date: anonymous 2020-01-24 02:27:10

  1. foundin changed to: "All to date"
  2. icomment:
    When making calls to the Win32 CreateFile() function, SQLite appears to always set the file sharing parameter dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE which allows the file to be opened for shared access across processes.  CreateFile() must be called with a dwShareMode = 0 in order to open the file in a true process exclusive access mode. See for full details.
    A side effect of this behavior is even when SQLite is configured for EXCLUSIVE WAL mode, users are still able to copy open SQLite database files on Windows using Explorer or other means which can result in corrupt copies that befuddle end users.
    To avoid this for our use cases, we're currently having to rebuild our own custom version of SQLite which allows us to force dwShareMode = 0.  We're reaching out and see if there would be any appetite to add an option to allow for a process exclusive file access mode in the upstream SQLite?
  3. login: "anonymous"
  4. mimetype: "text/plain"
  5. private_contact changed to: "a214446b313c03bc7875380263b179ad1b3e7c88"
  6. severity changed to: "Important"
  7. status changed to: "Open"
  8. title changed to:
    Add option for a process exclusive mode to open files on Windows
  9. type changed to: "Feature_Request"