Field editing problem after migration from v.5.70

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kiiver
Posts: 5
Joined: Tue 05 Apr 2011 11:23

Field editing problem after migration from v.5.70

Post by kiiver » Mon 11 Apr 2011 09:05

After upgrading ODAC from 5.70 to latest 7.10 there are problems to get application to edit/insert data.
All forms are using custom class inherited from TOraStoredProc witch overrides some procs and also assigns custom procedure to property OnUpdateRecord. CachedUpdates is true also.

Problem is that OnUpdateRecord does not even get executed as

Code: Select all

procedure TOraStoredProc.DoBeforeEdit;
begin
  inherited;

  if not (LocalUpdate or
    (SQLUpdate.Count > 0) or
    (Assigned(UpdateObject) and ((UpdateObject.ModifySQL.Count > 0) or (UpdateObject.ModifyObject  nil))))
  then
    Abort;
end;
gets executed and always aborts. Inherited class doesn't do anything with this proc.

In old odac this code was executed instead and worked:

Code: Select all

procedure TCustomOraQuery.DoBeforeEdit;
begin
  inherited;

  if not (IsKey or (FSQLUpdate.Count > 0) or LocalUpdate or
    (CachedUpdates and (UpdateStatus = usInserted) and
    (FSQLInsert.Count > 0)) or
    CachedUpdates and Assigned(OnUpdateRecord) or
    Assigned(UpdateObject))
  then
    Abort;
end;
Also tried initializing OraQueryCompatibilityMode true but with no change. Looks like should change inherit to other than TOraStoredProc?
Obviously there is different behavior but cannot figure out what code should i change to minimize rewriting and need some ideas.

kiiver
Posts: 5
Joined: Tue 05 Apr 2011 11:23

Post by kiiver » Mon 11 Apr 2011 09:49

I managed to get it working by overloading TOraStoredProc.DoBeforeEdit etc. to like is in TOraQuery.DoBeforeEdit (this proc seems to contain old behavior)
And still setting OraQueryCompatibilityMode = true
So far looks like my problems are solved.

Post Reply