Implemented global database lock
 Wait for lock on database #6