You are not logged in.
Pages: 1
hi,
i m doing some test and i have this preblem.
after insert/update/delete of a record i return in the form where i display all record in a grid.
so i use updatefromserver to know if my grid need a refresh.
this works fine except if i delete the only one record (last).
if not ControllerMain.Client.UpdateFromServer([Self.Elenco], NeedRefresh) then
begin
//raise exception //HERE WHEN I DELETE LAST RECORD! WHY?
end
else
begin
if NeedRefresh then
begin
// the client refresh all GUI about TSQLTestTable.
end;
end;
Thanks,
Emanuele
Offline
Is not UpdateFromServer() failing because the Self.Elenco was deleted?
When you delete a record, the TSQLDataBase.Lock() method will increase the server's InternalState so the refresh should be done.
Without more code to reproduce the issue, it is difficult to know what is wrong here.
Online
hi ab,
Self.Elenco is a TSQLTableJSON created onCreate of datamodule, and free onDestroy so self.Elenco wasn't deleted.
if u need i can post the code for delete record...
Offline
hi,
this is the portion of code for delete a record.
if Application.MessageBox('Sei sicuro di voler eliminare il record?',
'CONFERMA', MB_YESNO + MB_ICONQUESTION) = IDYES then
begin
ControllerMain.Client.TransactionBegin(Self.Tabella);
Try
ControllerMain.Client.Delete(Self.Tabella, ID);
ControllerMain.Client.Commit();
Except
on E: Exception do
begin
ControllerMain.Client.RollBack();
Application.MessageBox(PWideChar('Errore durante l''eliminazione del record: ' +
E.ClassName + #13#10 + E.Message),
'ERRORE', MB_OK + MB_ICONERROR);
end;
End;
end;
Offline
hi,
i step into update from server...
updatefrom server return false for a parsing error (return code 2).
i step also into ParseAndConvert.
i arrive at line 9973 repeat inc(P); if P^=#0 then exit; until P^='{'; // go to object beginning
then i have count 3 loop before exit.
loop 1 P^ = '['
loop 2 P^ = ']'
loop 3 P^ = #10
this can help u?
thanks,
Emanuele
Offline
hi ab,
any idea why i have this behavior?
thanks,
emanuele
Offline
hi ab,
before parsing JSON is
'[]'#$A
that i think its right because the table is empty, but if i have error on parsing updatefromserver dont refresh self.elenco and i have an exception.
where i mistake?
thanks
Offline
hi ab,
have u any idea for my question?
can i help u in other way?
thanks,
Emanuele.
Offline
hi ab,
i know thats its just my problem but i need to understand why updatefromserver don't work for me...
have u any idea?
thanks,
Emanuele.
Offline
I've fixed TSQLRequest.Execute(JSON: TStream) method in SynSQLite3.pas.
It now allows field names at least, even with no data (as expected by TSQLRestClientURI.UpdateFromServer).
See http://synopse.info/fossil/info/f633312bdc
It should fix your issue.
Online
Pages: 1