Master-detail and cached updates
Posted: Tue 18 Jul 2017 11:21
Hi to all,
I'm trying to set up a suite of tests with both FireDAC and UniDAC and am now testing the use of master-detail configurations. Without CachedUpdates I was able to get everything to work... inserts, updates and deletes.
But with CachedUpdates activated there are several things that I cannot wrap my head around:
1) I have to explicitly set Autoinc values client side, as it seems UniDAC is depending on server side calculation... and obviously this is needed in case I try to insert a master row, then insert one or more detail rows, and then apply the updates.
2) Foreign key violations when I apply a delete of a master row and all its detail rows. I presume this happens because it does not apply the deletes to the detail query before applying the delete to the master row.
Now... the second point is really blocking me. Of course inserts, updates and deletes must be applied in a specific order if the database has foreign keys. But I really cannot keep track of which updates have been made to the envolved datasets. That should be responsibility of the DAC layer. Am I missing something? Is there some work-around or specific setup I must use?
Thanks and regards,
Marco
I'm trying to set up a suite of tests with both FireDAC and UniDAC and am now testing the use of master-detail configurations. Without CachedUpdates I was able to get everything to work... inserts, updates and deletes.
But with CachedUpdates activated there are several things that I cannot wrap my head around:
1) I have to explicitly set Autoinc values client side, as it seems UniDAC is depending on server side calculation... and obviously this is needed in case I try to insert a master row, then insert one or more detail rows, and then apply the updates.
2) Foreign key violations when I apply a delete of a master row and all its detail rows. I presume this happens because it does not apply the deletes to the detail query before applying the delete to the master row.
Now... the second point is really blocking me. Of course inserts, updates and deletes must be applied in a specific order if the database has foreign keys. But I really cannot keep track of which updates have been made to the envolved datasets. That should be responsibility of the DAC layer. Am I missing something? Is there some work-around or specific setup I must use?
Thanks and regards,
Marco