"Another user changed the record" error not raised after conversion from BDE to FireDAC

109 Views Asked by At

I'm working on an application that we recently converted from BDE to FireDAC. I'm having a problem where the "Another user changed the record" mechanism is not working. If we ran two instances of the app against the same database, browsed to a given row in both, updated the row on one instance, and then in the other attempted to change the same field to a different value, we would always get the "Another user changed the record" error. After converting to FireDAC, the update on the second instance just overwrites the first user's change. I'm using a TFDQuery with an associated TFDUpdateSQL for its UpdateObject. I've tried changing UpdateMode to upWhereAll, but it doesn't change the behavior. What do we need to do differently in FireDAC for this to work?

Using an UpdateObject was needed with the BDE to make the TQuery "live" when the SQL had joins to other tables, etc. We were trying to do the conversion with as little change as possible to avoid introducing any new bugs. But now I'm wondering if I should just eliminate the UpdateObject and let FireDAC do its magic under the hood to make the query editable.

0

There are 0 best solutions below