Service Class using NewDataSet /NewCommand/ TDALocalDataAdapter

I want to confirm the usage on those command:

  1. IDADataset using
    as Below:
    dsM_Ins := AllTableDASchema.NewDataset(Connection,‘TEST_TBL’);;
    After finish dsM_Ins , need free it?

  2. IDASQLCommand usage
    cmdMtr := AllTableDASchema.NewCommand(Connection,‘MAKE_IOP_SUSPEND_STATUS’);

cmdMtr after using, need free?

  1. I create a service function to update aaa_tbl many records.
    I using below way to do:
    lda := TDALocalDataAdapter.Create(Self.Name);
    adt := TDAMemDataTable.Create(nil);
    adt.LogicalName := ‘AAA_TBL’;
    adt.RemoteDataAdapter := lda;
    adt.RemoteFetchEnabled := True;
    Doing_My_Update Logic;

Is it correct to use TDALocalDataAdapter like that?

  1. As IDADataset not support Locate function as it unidirectional dataset.
    if I need use locate , is it need use TDALocalDataAdapter with TDadatatable?

Please advise.


  1. you can just free it like
dsM_Ins := nil;
  1. the same:
cmdMtr := nil;
  1. yes, TDALocalDataAdapter is used in the same way as TDARemoteDataAdapter
  2. yes

As @EvgenyK say and as rule of dumb, for convention, “names” starting with I are interfaces and have reference counting support. Can be freed setting nil at convenience.