TOraQuery AfterRefresh

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
polsol
Posts: 71
Joined: Sun 20 May 2007 13:29
Contact:

TOraQuery AfterRefresh

Post by polsol » Mon 05 Nov 2007 11:46

Hi all,
I have a TOraQuery set to AutoCommitt and RefreshOptions set to roAfterInsert and roAfterUpdate.
I have some secondary processing set to the AfterRefresh event but the AfterRefresh Event doesn't fire on either an new record being entered or a record updated.
The AfterRefresh does, however, fire when a manual refresh is done.

Am I doing something wrong or is this a problem associated with AutoCommitt?

Regards,
Tony

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 05 Nov 2007 15:37

After you insert or update a record, only the current record is refreshed using the RefreshRecord method of TOraQuery. But AfterRefresh event handler is called only when the whole dataset is refreshed using the Refresh method.

If you need to get an event when the RefreshRecord method is called, you can add a handler for AfterUpdateExecute event. In this event handler you should check StatementTypes parameter:

Code: Select all

  if stRefresh in StatementTypes then begin
    ...
  end;

polsol
Posts: 71
Joined: Sun 20 May 2007 13:29
Contact:

Post by polsol » Tue 06 Nov 2007 03:48

Thanks for the info Plash. I don't think this is included in the on-line help so maybe it could be added for later versions?

Regards

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 08 Nov 2007 10:19

We'll consider possibility to improve ODAC help.

Post Reply