User Tools

Site Tools


rttk:uc:cacheupdates

Case: Cached Updates

Cached updates can be difficult to understand / diagnose, Marshal allows you to look at the dataset and database at the same time to understand what is pending and written to the actual database.

Implementation details

For this demo the form create event is used to start Marshal automatically. Here is the code:

uses
  dmMainComp, 
  VCL.SE.RTTK.Marshal, //Reference to the Marshal Unit
  Vcl.Clipbrd; //used to copy query to clipboard
 
{$R *.dfm}
 
procedure TfrmCachedUpdates.FormCreate(Sender: TObject);
begin
  inherited FormCreate(Sender);
  RegisterDS(qryProducts);
  TSERTTKWorker.ShowMarshal; //added to start Marshal
end;

Recreation

Start the demo sample Qry_CachedUpdates. Dock the Marshal form right and the query form left.

  1. Ordered List ItemConnect to the SQLite_Demo database.
  2. Click the button “Copy query to clipboard”.
  3. On the Marshal form expand dmlmaincomp and click on dbmain to inspect the database connection.
  4. Paste the query in the “Query Tool” tab and then click execute to run the query.
  5. Expand frmCachedUpdates and select qryProducts, then select the dataset grid tab to browse the dataset.
rttk/uc/cacheupdates.txt · Last modified: 2021/08/10 06:29 by wikiadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki