Bug in OracleDataset - UpdateStatus method

Helene

Member³
We recently upgraded to Delphi 2007, and DOA 4.1. After the upgrade we have been experiencing access violations in a particular form when saving data. The behaviour occured consistently.

After debugging I was able to get rid of the access violation, by making a small change to the UpdateStatus method. The following two lines:


Code:
Log := FindChangeLogByBookmark(PInteger(bm)^) as TChangeLogItem;
      FreeBookmark(bm);
were replaced with the following:


Code:
try
      if assigned(bm) then
        Log := FindChangeLogByBookmark(PInteger(bm)^) as TChangeLogItem;
    finally
      FreeBookmark(bm);
    end;
The check for a "not-assigned bookmark" made the access violation go away. I don't know why the GetBookmark doesn't return a valid bookmark in this case, but apparently it does not.

However, I am not certain the result which is returned will be correct :confused: ?? As far as I can see the result will now be either usUnmodified or usModified, while the correct result should have been usInserted in this case. So what can I do about that?

With regards,
Helene
 
I assume this only occurs in Delphi 2007? Because DOA 4.1 did not really change any UpdateStatus related functionality.
 
That's correct, this did not happen in Delphi 6. We went straight from Delphi 6 to Delphi 2007.

With regards
Helene
 
Back
Top