implement database-locks