Skip to Content
Motoko

The lease

sqliteStore's default lease is core's processLeases: one writer per scope across every processHost in the process, so two runtimes in one process never both write a scope. It is core's inProcessLeases(), made once for the process; a store that needs a lease table of its own passes lease: inProcessLeases(). It cannot see other processes: pi-durable has no cross-process locking, and SQLite's file locks do not make two Harnesses on one file safe. A deployment where two processes may open the same storage passes its own lease (a lock file, a database advisory lock) whose signal aborts when the lock is lost; the runtime then closes the instance at once.