Delta already present ERROR

Data Abstract 10.0.0.1469
Delphi Berlin

I recently installed 10.0.0.1469 and am now getting the following error from detail tables when applying updates. The detail tables are setup using the the master detail wizard on the client using automatic where. This a straight up and basic situation. The error message is:

First chance exception at $761E3DB2. Exception class EDAException with message ‘A delta called “PartNJSUEdit” is already present’. Process ProjectTestReleaseUpdates.exe (40608)

Because this has always worked and should work now, I think there may an issue with my installation of DA/RO. That said, I am not sure how to proceed. Please Help.

Hi,

can you create a simple testcase that reproduces this issue, pls?
you can send it to support@ for keeping privacy or attach it here.

TestMasterDetailForDASupport.zip (6.4 MB)

SQLite PcTrade database.

In the example I sent, the upper grid is the Orders Table, the lower grid is the Order Details table. Click the get Data button to get an Order with its details. Change the quantity in the order detail table and click the save data button.

When I do that on my installation, I get the following:

Thanks, logged as bugs://84046

pls update:

uDADataTable.pas
    procedure WriteDeltaToStream(aStreamer: TDADataStreamer; aOnlyWithSameDataAdapter: Boolean = False; aRecursive: Boolean = True); // aRecursive param was added
    procedure ReadDeltaFromStream(aStreamer: TDADataStreamer; aOnlyWithSameDataAdapter: Boolean = False; aRecursive: Boolean = True); overload; // aRecursive param was added
...
procedure TDADataTable.WriteDeltaToStream(aStreamer: TDADataStreamer; aOnlyWithSameDataAdapter: Boolean = False; aRecursive: Boolean = True); // aRecursive param was added
...
      if self.HasDelta then aStreamer.WriteDelta(Self);
      if aRecursive then begin //added
...
      end; //added
    finally
...
procedure TDADataTable.ReadDeltaFromStream(aStreamer: TDADataStreamer; aOnlyWithSameDataAdapter: Boolean = False; aRecursive: Boolean = True);// aRecursive param was added
...
    aStreamer.ReadDelta(Self);
  if aRecursive then begin //added
...
  end; //added
end;
uDARemoteDataAdapter.pas
procedure TDARemoteDataAdapter.InternalApplyUpdate_PrepareParams(
  aRequest: TDAUpdateDataRequest; aTables: array of TDADataTable);
...
      aTables[i].WriteDeltaToStream(DataStreamer, True, False); //changed
...
procedure TDARemoteDataAdapter.InternalApplyUpdate_ReadParams(
  aRequest: TDAUpdateDataRequest; aTables: array of TDADataTable);
...
          aTables[i].ReadDeltaFromStream(DataStreamer,True, False);//changed
...

bugs://84046 got closed with status fixed.

Thank you for the quick turnaround. Did you by chance check to see if the data actually saved after the fix? Either I incorrectly patched the files, or the data from the detail table does not save when saving the master. I think it should.

The error is indeed gone, so that is good.

BTW, my example program did not have the following line in the “GetData” code:

if Active then Close;

This means that if you hit the get data button after making changes and pressing the save data button, it would look like the data saved when it did not.

I just checked out the changed modules with my actual product on sql server, and the changes are indeed saving. It must have had something to due with my SqlLite configuration.

From my end, all is now good.

Thanks!

1 Like

I use DataAbstract for Delphi version 10.0.0.1481.

I receive the same error “Delta for already present”.

If I use master/detail connected tables and ApplyUpdates.
The first time I edit the master table and apply updates it works fine.

But if I then edit the table afterwards, without doing a refresh, and apply updates, I always receive the error.

I looked in the changelogs and this bug fix is already included in the DA version I am using.

Has there been further fixes to this error in later versions?

Hi,

you may have some corner case that requires specific testcase.
can you create a simple testcase w/o 3rd party components ike DevEx, etc that reproduces this issue, pls?
you can drop email to support@ for keeping privacy.

Hi,

I found the cause now - I have the same table (LogicalName) as a detail to “itself” as master.
So, two table components with the same LogicalName, in a master-detail relationship.

That is not possible, I guess, without having another table LogicalName.
Otherwise it will of course get the error, that there already is a delta with that LogicalName.

So, I will try and make a copy of the table in schema modeler, and give it another name.

That should work. Right now it works if I clear the mastersource from the detail table.

Hi,

you may try to use the CloneSource feature.
it also allows to use the same datasource in master/detail relations.

see more about this feature in the ClonedSource (Desktop) article.