EDAUpdatesFailedException when updating table with a trigger

Hi,
I recently added a trigger to a table in SQLServer, that performs updates to 6 other tables when a certain field is changed. Now, when I edit and post the change in this table I get the following:
"Project … raised exception class EDAUpdatesFailedException with message ‘One or more updates failed to apply on the server’.

3161: No rows were affected by this update

Please assign a TDAReconcileProvider to the data adapter for better exception reporting and reconciliation UI)’."
Now in the trigger, the tables are not always update and the affected rows are 0. Does this connect with the exception I’m getting? If yes, is there a workaround?

Thank you.

Regards,
Chris

Hi,

this error means that update wasn’t performed.
it may happened if wrong where condition was applied.
for example this error will be raised for UPDATE ... WHERE 2=3.

You can disable this checking if you set poIgnoreRowsAffected in BusinessProcessor.ProcessorOptions

if you don’t have separated BusinessProcessor component, you can use the DataService.OnBusinessProcessorAutoCreated event for this purpose, like:

if BusinessProcessor.ReferencedDataset = 'mytable' then
   BusinessProcessor.ProcessorOptions := BusinessProcessor.ProcessorOptions + [poIgnoreRowsAffected];
1 Like

Hi,

The thing is that the update happens. If I make and update statement in the SSMS, it runs without error, just prints in the Message area:

(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
(0 row(s) affected)
(1 row(s) affected)

Which tells me the current record was not found in the other six tables, but it was updated in the table with the trigger. Maybe this is what causes the error to show? It reads that 0 rows affected on top?

Chris

Hi,

it may depend on driver you are using.
for example, for ADO, it said

1 Like