/**
  * (non-PHPdoc)
  * @see \oat\tao\model\lock\LockSystem::setLock()
  */
 public function setLock(core_kernel_classes_Resource $resource, $ownerId)
 {
     $lock = $this->getLockData($resource);
     if (is_null($lock)) {
         $clone = $this->deepClone($resource);
         SqlStorage::add($ownerId, $resource, $clone);
         WorkspaceMap::getCurrentUserMap()->reload();
     } elseif ($lock->getOwnerId() != $ownerId) {
         throw new ResourceLockedException($lock);
     }
 }