Re: Updatebatch question



>Suppose you have the following code:
>try
>      Data.ADOConnection.BeginTrans;
>      MasterTable.UpdateBatch;
>      RelatedTable.UpdateBatch;
>      Data.ADOConnection.CommitTrans;
>except
>      Data.ADOConnection.RollbackTrans;
>end;
>
>If something fails (transaction rolls back):  can I reapply UpdateBatch? Are 
>cached updates lost?
If RelatedTable.updateBatch fails you can't  just reapply MasterTable batch.
Once the mastertable batch update succeeds the clientside Records reflect that
they have been updated.
You can use the tadoDataset.savetoFile to save a copy of the records in their
current state so you can reload it if the transaction fails

TbetterADodataset a free TadoDatset defendant component supports a
savetoAdoStream method
http://betterado.hit.bg/
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.



Relevant Pages

  • Updatebatch question
    ... If something fails (transaction rolls back): can I reapply UpdateBatch? ...
    (borland.public.delphi.database.ado)
  • UpdateBatch question
    ... If something fails (transaction rolls back): can I reapply UpdateBatch? ...
    (microsoft.public.data.ado)