protected function removeSessionLock(ObjectId $oid, $type) {
    $locks = $this->getSessionLocks();
    if (isset($locks[$oid->__toString()])) {
      $lock = $locks[$oid->__toString()];
      if ($type == null || $type != null && $lock->getType() == $type) {
        unset($locks[$oid->__toString()]);
        $this->session->set(self::SESSION_VARNAME, $locks);
      }
    }
  }