More database locking