Lock on DB - only when writing