Add locks to cache db