Briefcase and Clone DAMemDataTable

Hi
I am tying to use the briefcase-Mode adopted sample application.

There are 2 tables loaded and saved to briefcase and 1 Clone table.

At some point having a strange situation, on LoadData procedure: 2 tables are loaded from briefcase, Clone table doesn’t show any data loaded.

To fix it I have to Invalidate briefcase and reload app again , then 2 tables are loaded from briefcase and Clone table shows data loaded and till the next restart. Next time when app launched , having same problem => no data in Clone table.

Same time if I’m running LoadFromServer ( directly, no briefcase) => Clone table shows data loaded ;

I have it checked on RO briefcase sample application, and it’s working as expected, which means that I have something messed up in my app, but could not find what may be the reason.

Will be much appreciated any help .

can you create a simple testcase that demonstrates this issue, pls?
you can attach it here or send directly to support@

Just found that in case of Invalidate briefcase and reloading the app again, program running LoadFromServer procedure , which is direct call to server, that’s why data appears on Clone table.

LoadData taking it from briefcase and by some reason Clone table not able to display data from it.

try to attach cloned table after loading from briefcase, will it work?

Have LoadData modified accordingly , but no luck yet, still Clone not showing data, same time I can browse Briefcase data with DA Briefcase Explorer:

procedure TDM.LoadData;
var
  lbriefcaseName: string;
  lbriefcase: TDAFolderBriefcase;
begin

  lbriefcaseName := GetBriefcaseFileName;

  tbl_CloneTk.Filtered := false;
  tbl_CloneTk.CloneSource := nil;
  tbl_CloneTk.ClonedAutoOpen := false;

  if not DirectoryExists(lbriefcaseName) then
  begin
    LoadFromServer;
  end
  else begin
    lbriefcase:= TDAFolderBriefcase.Create(lbriefcaseName,True,True);
    if ValidateBriefcase(lbriefcase) then begin
      GetTablesFromBriefcase(lbriefcase);
      showmessage('load from brcase');
    end
    else begin
      LoadFromServer;
    end
  end;
  tbl_CloneTk.CloneSource := tbl_MainTk;
  tbl_CloneTk.ClonedAutoOpen := true;

end;

can you attach full testcase with briefcase instead of posing pieces of code ?


Edit: I can’t reproduce this problem.
try to do these steps:

  • open BriefCase sample (non console)
  • launch it, so briefcase will be created
  • drop TDBGrid, TDADataSource and TDAMemDataTable to main form
  • link them and set ClientDataModule.tbl_Products as CloneSource + set ClonedAutoOpen to true.
  • launch again and see that cloned table contains data

Sorry about that , it’s just too many fiddling done in app so far with custom filters and threaded updates , so this will take a while to strip it up.

I have concept of cloning tables tested on RO Briefcase sample and it’s working as expected, but when I have it in “real life” app , that’s where I have a hiccups.

Now one thing is to rewrite my app altogether from scratch and other approach knock off functions one by one till the moment of truth.

in any way this will take a time.

try to do steps from my previous post

Hi Evgeny

Have it tested in your way and in “mine” way :grinning:

Your way is working , as I have posted before,
but in my way (connected to remote server ) not. I will send demo project in a minute.

just open cloned table like

procedure TClientDataModule.GetTablesFromBriefcase(briefcase: TDABaseBriefcase);
begin
  AddToLog('Loading tables from the briefcase...');

  briefcase.Fill([tbl_StockTk],True);
  Self.tbl_Clone.open; //<<<<<<<<<<<<<
end;

Have it sorted.
Thank you!