AfterUpdateExecute/BeforeUpdateExecute of TOraQuery with single row refresh

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
keckhard
Posts: 12
Joined: Fri 08 Apr 2005 09:18

AfterUpdateExecute/BeforeUpdateExecute of TOraQuery with single row refresh

Post by keckhard » Wed 02 Jan 2008 10:01

hello,
we use TOraQuery (Odac for Delphi 2007, version 6.10.1.10 02.08.07) to query and manipulate data. after an insert or update we use single row refresh for refreshing the grid belonging to the dataset. to specify the query parameters for the single row refresh we use the BeforeUpdateExecute event :

if (StatementTypes = [stRefresh]) then begin Params.ParamByName('ARTKMK_ID').AsInteger:=qGetArtkMKCur.Params.ParamByName('ARTKMK_ID').AsInteger;
qGetArtkMKCur.Params.ParamByName('ARTKMK_ID').clear;
end;

the ARTKMK_ID mentioned above is preserved during AfterUpdateExecute:
if (StatementTypes [stRefresh]) then qGetArtkMKCur.Params.ParamByName('ARTKMK_ID').AsInteger:=Params.ParamByName('ARTKMK_ID').AsInteger;

ARTKMK_ID is a returning value from the insert/update statement and is the id of the newly inserted or updated row.

this works always fine for the first inserted or updated row. but if i try to insert/update a second record (immediatley after inserting/updating the first record), the AfterUpdateExecute is not called and the BeforeUpdateExecute is called only one times (instead of one times for StatementTypes = [stInsert] and one times for StatementTypes = [stRefresh]). thus, for the second insert/update the id of the new record is not preserved and even it would be reserved, the parameter for the single row refresh is not set and the refresh fails because it finds more than one record.

after executing a full refresh of TOraQuery, single row refresh for inserting/updating a row works one times and fails again for the second row.

have i misunderstood the functionality of AfterUpdateExecute/BeforeUpdateExecute or is this a bug?

thx and br, klaus eckhardt.

keckhard
Posts: 12
Joined: Fri 08 Apr 2005 09:18

TSmartQuery has the same behaviour

Post by keckhard » Thu 03 Jan 2008 10:10

hello support,
today i've tested the single row refresh of TSmartQuery unfortunately it has the same behaviour.
br, klaus eckhardt.

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

Post by Plash » Thu 03 Jan 2008 10:37

We could not reproduce the problem. Please send to odac*crlab*com a complete small sample that demonstrates the problem, including script to create database objects.

keckhard
Posts: 12
Joined: Fri 08 Apr 2005 09:18

did you receive my update?

Post by keckhard » Tue 08 Jan 2008 07:50

Hi Plash,
last week i sent an update with a demo project, create scripts for database objects and a test-scenario regarding the problem with the single row refresh to [email protected]. i just want to know if you have received my email and if you are now able to reproduce the problem.
thx and br, klaus.

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

Post by Plash » Tue 08 Jan 2008 09:08

We have received your mail.

The bug is fixed in later builds of ODAC. You should upgrade ODAC to the last build.

keckhard
Posts: 12
Joined: Fri 08 Apr 2005 09:18

Post by keckhard » Tue 08 Jan 2008 09:41

Hi Plash,
after receiving your mail, i've immediately tested the single row refresh with the newest version of odac. everything works fine now.
thx and br, klaus.

Post Reply