Hello,
I'm using ODAC 8.1.4 with Embarcadero RAD Studio 2010 Version 14.0.3513.24210
I use TOraQuery in CachedUpdates mode. I use TOraUpdateSQL with DeleteSQL, ModifySQL and InsertSQL set.
1)
1.1) When I delete the last record from q:TOraQuery and call ApplyUpdates and get no exception from Oracle, it works fine
1.2) When I get EDatabaseError during call of q.ApplyUpdates, because of my integrity constraints on Oracle, I handle it in q.OnUpdateError and give to user meaningful Warning and write UpdateAction :=uaSkip;
1.3) After showing my dialog box, it raises Access Violation exception.
"Access Violation at address 006149FF ...".
1.4) When I have more than one record in dataset, this exception does not take place.
1.5) I copied Insert,Update,Delete statements into TOraQuery corresponding fields and deleted TOraUpdateSQL. It has no effect. AV Exception remains.
2) The same thing occurs, when I call ApplyUpdates on an empty dataset. But I can prevent it by checking
if q.UpdatesPending then q.ApplyUpdates.
Please help me what to do in first case?
I read in history, that in version
"6.00.0.6 20-Apr-07"
- AV failure with deleting records in CachedUpdates mode fixed
But it still occurs.
Access Violation on deleting records in CachedUpdates mode
-
jeff_alieffson
- Posts: 2
- Joined: Tue 30 Oct 2012 02:54
Re: Access Violation on deleting records in CachedUpdates mode
Hello,
We cannot reproduce the problem. AV doesn't occur when calling the ApplyUpdates method when the error occurs and is handled in the UpdateError event in the following way:
Please try to reproduce the problem on the latest ODAC version 8.5.9, if the error can be reproduced, send a project demonstrating the problem and a script for creating DB objects to alexp*devart*com
We cannot reproduce the problem. AV doesn't occur when calling the ApplyUpdates method when the error occurs and is handled in the UpdateError event in the following way:
Code: Select all
procedure TForm1.OraQuery1UpdateError(DataSet: TDataSet; E: EDatabaseError;
UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction);
begin
if MessageDlg('continue?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then
UpdateAction := uaSkip;
end;-
jeff_alieffson
- Posts: 2
- Joined: Tue 30 Oct 2012 02:54
Re: Access Violation on deleting records in CachedUpdates mode
Error occurs, only when I delete the last record from TOraQuery and get
an exception from Oracle, after handling my exception I get AV.
The key word here is "the last record"
Here is a brief chunk of code. I just want to show the situation
an exception from Oracle, after handling my exception I get AV.
The key word here is "the last record"
Here is a brief chunk of code. I just want to show the situation
Code: Select all
var
qArrival:TOraQuery;
uArrival:TOraUpdateSQL;
...
qArrival.CachedUpdates:=True;
qArrival.UpdateObject:=uArrival;
qArrival.SQL.Clear;
qArrival.SQL.Add('SELECT * FROM V$ARRIVAL WHERE NBR=:NBR1 ORDER BY ART,SUB_ART');
...
update/delete/insert SQLs are set into uArrival too.
...
procedure TfmData.qArrivalUpdateError(DataSet: TDataSet; E: EDatabaseError;
UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction);
begin
MessageDlg(E.Message,mtError,[mbOK],0);
UpdateAction :=uaSkip;
end;
Re: Access Violation on deleting records in CachedUpdates mode
hello,
This problem really occurs in ODAC version 8.1.4. AV doesn't occur in ODAC version 8.5.9 after deleting the last record in the UpdateError method.
Please download the latest ODAC version and check this again
This problem really occurs in ODAC version 8.1.4. AV doesn't occur in ODAC version 8.5.9 after deleting the last record in the UpdateError method.
Please download the latest ODAC version and check this again