Board index » delphi » I have posted a free component (and DB.PAS patch) to assist with D2 cached updates

I have posted a free component (and DB.PAS patch) to assist with D2 cached updates

Faced with the problems of cached-updates in D2, I created a small
component to help deal with this and various related problems.
This is a work-in-progress, an "as-is" contribution, and wholly
unsupported code, but I'm glad to offer it for your amu{*word*224}t and
amazement.

        ftp://ftp.primenet.com/users/s/sundial/sundbqry.zip

Now, I also found that when Delphi is processing cached updates in a
master/detail relationship, it requeries the details causing their
cached updates to be lost.  To address this problem I made the following
small local-modification to Borland's DB.PAS unit:

{ ? Borland International }
function TDataSet.ProcessUpdates(UpdCmd: DBIDelayedUpdCmd): DBIResult;
begin
  CheckCachedUpdateMode;
  UpdateCursorPos;
  Result := DbiApplyDelayedUpdates(Handle, UpdCmd);
  {
    Local modification to disable requerying of child datasets during
cached
      updates - an action which causes those changes to be lost.  The
original
      statement was not conditional; the "if" was added.
  }
  if (UpdCmd <> dbiDelayedUpdPrepare) then begin
    Resync([]);
  end;
end;

Enjoy.

 

Re:I have posted a free component (and DB.PAS patch) to assist with D2 cached updates


Do Delphi3.01 have the same problem?

Re:I have posted a free component (and DB.PAS patch) to assist with D2 cached updates


Great approach here, I like it very much, but confused with some bits of
it.
1.Does it work with Delphi 2.01 only, or Delphi 3 (3.01) as well?
2.A general description of use (you know - half a page of how to) or a
working master/detail example would help a lot.
Thanks anyway - I am doing something along this lines too and do think this
is the only way to go. Especially if you want pessimistic locking - it gets
really {*word*193}, if you do...

Sergei Zhyzhyn
zh...@sherwood.co.uk

Mike & Nancy Robinson <sund...@primenet.com> wrote in article
<344D5AD0.7...@primenet.com>...

Quote
> Faced with the problems of cached-updates in D2, I created a small
> component to help deal with this ...
> ....
>    ftp://ftp.primenet.com/users/s/sundial/sundbqry.zip

> Now, I also found that when Delphi is processing cached updates in a
> master/detail relationship, it requeries the details causing their
> cached updates to be lost.  To address this problem I made the following
> small local-modification to Borland's DB.PAS unit...
> ...

Re:I have posted a free component (and DB.PAS patch) to assist with D2 cached updates


Another way to avoid problems with master/detail problems is not to use
the Borland provided procedure ApplyUpdates.  The problem is that you
need to disconnect the DataSources before applying updates in
master/detail relationships.  Otherwise the applying of detail records
will not work right.

Quote
Zhyzhyn S. wrote:

> Great approach here, I like it very much, but confused with some bits of
> it.
> 1.Does it work with Delphi 2.01 only, or Delphi 3 (3.01) as well?
> 2.A general description of use (you know - half a page of how to) or a
> working master/detail example would help a lot.
> Thanks anyway - I am doing something along this lines too and do think this
> is the only way to go. Especially if you want pessimistic locking - it gets
> really {*word*193}, if you do...

> Sergei Zhyzhyn
> zh...@sherwood.co.uk

> Mike & Nancy Robinson <sund...@primenet.com> wrote in article
> <344D5AD0.7...@primenet.com>...
> > Faced with the problems of cached-updates in D2, I created a small
> > component to help deal with this ...
> > ....

> >       ftp://ftp.primenet.com/users/s/sundial/sundbqry.zip

> > Now, I also found that when Delphi is processing cached updates in a
> > master/detail relationship, it requeries the details causing their
> > cached updates to be lost.  To address this problem I made the following
> > small local-modification to Borland's DB.PAS unit...
> > ...

Other Threads