anchor.diff:          if ServerContext.ResConfig[aType].LastResourceId > ServerContext.ResConfig[aType].storedResourceId then
           begin
             ServerContext.ResConfig[aType].storedResourceId := ServerContext.ResConfig[aType].LastResourceId + KEY_SAVE_SIZE;
  -          DB.ExecSQL('Update Types set LastId = '+inttostr(ServerContext.ResConfig[aType].storedResourceId)+' where ResourceTypeKey = '+inttostr(ServerContext.ResConfig[aType].key), 'key-update');
  +          connection.ExecSQL('Update Types set LastId = '+inttostr(ServerContext.ResConfig[aType].storedResourceId)+' where ResourceTypeKey = '+inttostr(ServerContext.ResConfig[aType].key));
           end;
         end;
       end;
  
positive.code:     if guid then
      begin
        id := FhirGUIDToString(CreateGUID);
        key := FRepository.NextResourceKeySetId(aType, id);
      end
      else
      begin
  
negative.code:   result := iType > 0;
    if result then
    begin
      resourceKey := FRepository.NextResourceKeySetId(FConnection, aType, id);
  
      FConnection.SQL := 'Select ResourceKey from Ids where ResourceTypeKey = :r and Id = :i';
      FConnection.Prepare;
  