#1 2012-11-20 08:41:27

dollee
Member
Registered: 2012-08-01
Posts: 3

found error in TSQLRestClientURI.Commit and TSQLRestClientURI.rollback

  FDBClient := TSQLIte3HttpClient.Create('localhost', '8080', FSQLModel);

  ASessionID := GetCurrentThreadID;
  FDBClient.TransactionBegin(TAPM_STRING_DATA, ASessionID);
  try
  
    …
    …
    FDBClient.Commit(ASessionID);  // <-- it dosen't work!!! TSQLite3HttpClient.TransactionBegin accept session id only "1"!!!
  except
    FDBClient.Rollback(ASessionID);  // <-- it dosen't work!!! TSQLite3HttpClient.TransactionBegin accept session id only "1"!!!
  end;

fixed code

procedure TSQLRestClientURI.RollBack(SessionID: cardinal);
begin
//  inherited Rollback(SessionID); // reset fTransactionActive flag
  inherited Rollback(CONST_AUTHENTICATION_NOT_USED);   // <-- fixed
  URI(Model.Root,'ABORT');
end;

procedure TSQLRestClientURI.Commit(SessionID: cardinal);
begin
//  inherited Commit(SessionID); // reset fTransactionActive flag
  inherited Commit(CONST_AUTHENTICATION_NOT_USED);    // <-- fixed
  URI(Model.Root,'END');
end;

Offline

#2 2012-11-20 10:43:47

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: found error in TSQLRestClientURI.Commit and TSQLRestClientURI.rollback

You are right.

I've fixed TSQLRestClientURI.Commit/RollBack to work as expected by TSQLRestClientURI.TransactionBegin().
The CONST_AUTHENTICATION_NOT_USED parameter was expected to be supplied here!

Thanks a lot for the feedback.

See http://synopse.info/fossil/info/faffe2f286

Offline

Board footer

Powered by FluxBB