Lock model and tests (tests write and read from db)