fix concurrency by using a global database file lock