Concurrency
LibRed is a single-writer engine.
- Several connections in one process are fine. A
.accdbis a shared-file database, and LibRed opens it shared by default. Connections to the same file in one process share one page cache, so each one sees the others’ committed writes. - Transactions are isolated. Writes are held back until commit and then published together, so no other connection can see a transaction’s uncommitted pages, and a rollback never discards another connection’s committed work. A transaction whose pages were changed underneath it fails at commit with a write-conflict error instead of overwriting them.
- Two processes writing the same file corrupt it. LibRed has no lock file and no cross-process page or record locking. Its page locks are process-local. Don’t let LibRed write to a file that Access, ACE or another LibRed process is writing to at the same time.
Operations that rewrite the whole file, such as changing the password or the page encoding through
LibRed.Core, need the file to themselves, as they do in ACE. Opening it fails while anyone else holds the file.
Multi-writer support, compatible with Access’s own locking, is planned.