Recent

Author Topic: [closed] BufDataSet and mORMot  (Read 877 times)

BSaidus

  • Hero Member
  • *****
  • Posts: 538
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
[closed] BufDataSet and mORMot
« on: December 06, 2020, 10:08:04 pm »
Hello,
I have a simple remote dbaccess application with mormot (http) and saving data in TBuffdataset.
I use function to execute SQL statement and return data into Bufdataset.
First time it execute fine but if I try to reexecute more times it generate the following infos:
Code: Pascal  [Select][+][-]
  1. 007FA22B 8b34d6                   mov    (%esi,%edx,8),%esi
  2. 007FA22E 85f6                     test   %esi,%esi
  3. 007FA230 7409                     je     0x7fa23b <BUFDATASET$_$TDOUBLELINKEDBUFINDEX_$__$$_COMPAREBOOKMARKS$PBUFBOOKMARK$PBUFBOOKMARK$$LONGINT+75>
  4. 007FA232 39f7                     cmp    %esi,%edi
  5. 007FA234 7405                     je     0x7fa23b <BUFDATASET$_$TDOUBLELINKEDBUFINDEX_$__$$_COMPAREBOOKMARKS$PBUFBOOKMARK$PBUFBOOKMARK$$LONGINT+75>
  6. 007FA236 3b7334                   cmp    0x34(%ebx),%esi
  7. 007FA239 75ed                     jne    0x7fa228 <BUFDATASET$_$TDOUBLELINKEDBUFINDEX_$__$$_COMPAREBOOKMARKS$PBUFBOOKMARK$PBUFBOOKMARK$$LONGINT+56>
  8. 007FA23B 39fe                     cmp    %edi,%esi
  9. 007FA23D 7405                     je     0x7fa244 <BUFDATASET$_$TDOUBLELINKEDBUFINDEX_$__$$_COMPAREBOOKMARKS$PBUFBOOKMARK$PBUFBOOKMARK$$LONGINT+84>
  10. 007FA23F f7d8                     neg    %eax
  11. 007FA241 8d7600                   lea    0x0(%esi),%esi
  12. 007FA244 5f                       pop    %edi
  13. 007FA245 5e                       pop    %esi
  14. 007FA246 5b                       pop    %ebx
  15. 007FA247 c3                       ret    
  16. 007FA248 0000                     add    %al,(%eax)
  17. 007FA24A 0000                     add    %al,(%eax)
  18. 007FA24C 0000                     add    %al,(%eax)
  19. 007FA24E 000085d2740d85c974098b02 add    %al,(%eax)
  20. BUFDATASET$_$TDOUBLELINKEDBUFINDEX_$__$$_SAMEBOOKMARKS$PBUFBOOKMARK$PBUFBOOKMARK$$BOOLEAN
  21. 007FA250 85d2                     test   %edx,%edx
  22.  
If I execute outside the IDE then the application desapear.
I suspect a bug in the component: TBufDataset.
this is a function I use.

Code: Pascal  [Select][+][-]
  1. function fQueryOpen_fpc(var oQuery: TQuery; var oDs: TBufDataset;
  2.   iRecNumber: Integer; bGoLast: Boolean): Boolean;
  3. var
  4.   Stmt: ISQLDBRows;
  5. begin
  6.  
  7.   Result := False;
  8.   Screen.Cursor := crHourGlass;
  9.   oDs.DisableControls;
  10.   try
  11.     if iRecNumber = -1 then
  12.       fQueryAddLimitSQL(oQuery, 150)
  13.     else if iRecNumber > 0 then
  14.       fQueryAddLimitSQL(oQuery, iRecNumber);
  15.     Stmt := gfP.Execute( oQuery.SQL.Text, [] );
  16.     if oDs.FieldCount = 0 then
  17.     begin
  18.       if ToClientDataSet( oDs, Stmt.Instance, 0, cdsNew, False ) then
  19.       begin
  20.         //oDs.Open;
  21.         Result := true;
  22.       end;
  23.     end else
  24.     begin
  25.       //with oDs do
  26.       //begin
  27.       //  oDs.Clear;
  28.       //  if Active then
  29.       //    Close;
  30.       //  oDs.ClearIndexes;
  31.       //  oDs.FieldDefs.Clear;
  32.       //end;
  33.       if ToClientDataSet( oDs, Stmt.Instance, 0, cdsReplace, False ) then
  34.       begin
  35.         //oDs.Open;
  36.         Result := true;
  37.       end;
  38.     end;
  39.  
  40.   finally
  41.     Screen.Cursor := crDefault;
  42.     oDs.EnableControls;
  43.   end;
  44.  
  45. end;        
  46.  


PS: It happens MOSTELY when I do navigate in Grid.

Help guys, :) Help.
« Last Edit: December 07, 2020, 08:39:15 pm by BSaidus »
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

BSaidus

  • Hero Member
  • *****
  • Posts: 538
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
[closed] BufDataSet and mORMot
« Reply #1 on: December 07, 2020, 08:39:02 pm »
Hi all,
Finally the problem is with RxDBGrid with multiselect option checked, and not related to TBufdataset.

Thank you.
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

 

TinyPortal © 2005-2018