locking of main.db nearly complete