public function lock($onChanged=null)
    {
        $lock = new Locking\PessimisticLock($this);
        $locked = $lock->acquire();

        if (is_callable($onChanged) && !$locked->equals($this)) {
            call_user_func($onChanged, $this, $locked);
        }

        // reload data from locked
        $this->_data = $locked->_data;

        return $this;
    }