bug report: zeos with Developer Express db components

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Locked
zx
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 13.10.2005, 14:05

bug report: zeos with Developer Express db components

Post by zx »

[problem]
there is a collection of components by Developer Express inc.
called Quantum Grid Suite. it contains numerous dbControls.
when I use them with zeos dbo I often receive exceptions
like Invalid Pointer Operation or something like that.

a day of digging exposed such a reason.

this failure raises only when we use a couple of
master - detailed queries where detail query is zQuery and
it is linked with zQuery.DataSource property and a parameter in
sql like:
sql='select * from detail_table where masterkey=:id'

the error happens only if we do not create TField objects
for detail zQuery manually.

so the error scenario is:
zDetailQuery connected to some dataset via DataSource and a
parameter in its SQL,
srcDetailQuery - data source feed with data from zDetailQuery,
and some dbControls linked to srcDetailQuery datasource.
make both master dataset and zDetailQuery active.
and next we change the record in master dataset causing the
zDetailQuery to fetch the next batch of its records.
this is the very moment the exception raises.

the reason is that when we shift a record in master dataset
a method TZAbstractRODataset.RefreshParams is called for zDetailQuery.
here it is.

Code: Select all

procedure TZAbstractRODataset.RefreshParams;
var
  DataSet: TDataSet;
begin
  DisableControls;
  try
    if FDataLink.DataSource <> nil then
    begin
      DataSet := FDataLink.DataSource.DataSet;
      if DataSet <> nil then
        if DataSet.Active and (DataSet.State <> dsSetKey) then
        begin
		  Close;
		  Open;
        end;
    end;
  finally
    EnableControls;
  end;
end;
when it does Close and Open it re-creates the FTield objects of zDetailQuery.
but devExpress dbControls are not notified of changes happening to
field objects they are linked to because
zDetailQuery.DisableControls have been executed earlier.
and the nature of this controls prevents them from noticing such a change
while being disabled. it results in invalid pointer operation after
controls were enabled with EnableControls and began to address their TFields
at dead adresses.

[suggested solution]

i am not sure it is DEFINITELY correct and that is a question but

(scope)
======== [component\ZAbstractRODataset.pas] ========
procedure TZAbstractRODataset.RefreshParams;
(origin)
{
if DataSet.Active and (DataSet.State <> dsSetKey) then
begin
Close;
Open;
end;
}
(change into)
{
if DataSet.Active and (DataSet.State <> dsSetKey) then
begin
// Close;
// Open;
Refresh;
end;
}

helped me OK.

> thus i ask respected developers to check it out and to make a
> decision how to enable such a behaviour in a safe way.

[platform notes]
zeosdbo-6.5.1-alpha_cvs_13-10-2005(or any other 6.5.1)
delphi7

devExpress Quantum Grid Suite 5.x
(4.x versions did not have such a problem before
4_5_2 version introduced such a behaviour of controls)

best wishes.
Michael
ZeosLib's Handyman :o)
ZeosLib's Handyman :o)
Posts: 189
Joined: 15.08.2005, 16:08
Location: Wehrheim
Contact:

Post by Michael »

Hi zx,

could you please create a new bug report in the bug tracker at SourceForge. This would be very nice. ;-)

Tanks in advance.
:prog2: Use the source, dude!

[align=right]..::.. ZeosLib on SourceForge ..::..[/align]
Locked