RODA Gurus,
I have a WebvService (ie wsCopyEntity), which has the purpose of copying the given record(s) in a master table and all its respective detail records. This method is generic such that any record of any table can be copied thru this function. This method uses TDAMemDataTables which are bound to a LocalDataAdapter as follows:
begin
lcdsSrc := TDAMemDataTable.Create(self);
lcdsDst := TDAMemDataTable.Create(self);
try
// INTERATE THRU EACH MASTER PK
lEntityName := aCopyEntity.zMaster;
lEntityNV := aCopyEntity.zNameValue;
// CDS TO COPY FROM
lcdsSrc.LogicalName := lEntityName;
lcdsSrc.RemoteFetchEnabled := True;
lcdsSrc.RemoteDataAdapter := lLDA;
lcdsSrc.LoadSchema; // TAKES ~5sec
lcdsSrc.DynamicWhere.Clear;
lWhereSrc := lcdsSrc.DynamicWhere;
// CDS TO COPY INTO
lcdsDst.LogicalName := lEntityName;
lcdsDst.RemoteFetchEnabled := True;
lcdsDst.RemoteDataAdapter := lLDA;
lcdsDst.LoadSchema; // TAKES ~5sec
lcdsDst.DynamicWhere.Clear;
This snippet of code is called in a loop recursively As currently designed this method works. However, the LoadSchema calls each take ~5 seconds time the number or records. So a given request takes several minutes.
QUESTION:
How can I change the design to speed the LoadSchema calls?
Thank You.
Monte Carver