Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: CachedUpdates in 3 levels



Permlink Replies: 4 - Last Post: Dec 20, 2016 1:29 AM Last Post By: Brent Rose
Pablo Anizio

Posts: 10
Registered: 6/10/08
CachedUpdates in 3 levels
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 14, 2016 5:33 AM
Can i work with firedac in cachedupdates mode with master/detail/subdetail? If yes, i need a little example.
Brent Rose

Posts: 126
Registered: 9/23/00
Re: CachedUpdates in 3 levels
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 18, 2016 12:08 PM   in response to: Pablo Anizio in response to: Pablo Anizio
Tragically, I think you'll find the answer is ultimately "No".

There is quite a lot of documentation about caching data with FireDAC,
and it certainly "looks" like it will do the job at first glance, BUT,
there is a major (!!) shortcoming...

FireDAC does NOT support nested datasets like TClientDataSet does in
respect of master/detail data, so it can NOT cache full master/detail
structures. Specifically, as you scroll your master dataset records at
whatever level of nesting, FireDAC will have to fire off more
transactions to retrieve the new detail records (because they are NOT in
the cache). This entirely defeats the purpose of the cache!

TClientDataSet fully caches the entire m/d structure to multiple levels.

The fact that FireDAC cannot cache m/d data is a bit of a show-stopper
for me because I regard being able to do so as fundamental to almost any
but the most simple application. I have had to continue using
TClientDataSet and the older data access suites (eg IBX).

Given that FireDAC is Embarcadero's prime data access suite, with
TClientDataSet supposedly being deprecated eventually, it is a very
worrying issue. It has been several years since the advent of FireDAC
now, and there is no sign that it is ever intended to cache m/d data
(and every sign, of course, that TClientDataSet and the data access
technologies that work with it are a developmental dead-end).

This issue seems to get quietly buried somehow. It would be great to
know how other people are managing m/d data these days. Does no-one
(using FireDAC) need to cache it? Is there another strategy with FireDAC
to edit a master record and its (possibly multi-level) detail records as
a single cached entity?

Indeed, how does Embarcadero view this problem??? Perhaps it is a
"non-issue" for some reason? I'd love to know ;-)


On 15/12/2016 2:33 a.m., Pablo Anizio wrote:

Can i work with firedac in cachedupdates mode with master/detail/subdetail? If yes, i need a little example.
William Tucker

Posts: 14
Registered: 12/17/09
Re: CachedUpdates in 3 levels
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 19, 2016 1:13 PM   in response to: Brent Rose in response to: Brent Rose
Brent Rose wrote:

This issue seems to get quietly buried somehow. It would be great to
know how other people are managing m/d data these days.

We are in the same boat; and, we have come to the same conclusions. We
are still using TClientDataSet because of nested datasets.

But, TClientDataSets also have some serious problems in 64 bits. Is
anyone else trying to use TClientDataSet in x64?

The problems come from the Midas library (which TClientDataSet uses as
its store). One of the problems has been fixed:
https://quality.embarcadero.com/browse/RSP-12470;
but, others remain:
https://quality.embarcadero.com/browse/RSP-14991?filter=12622.

The problems are caused by callbacks from Midas and the way
TClientDataSet uses them. TClientDataSet passes its own address to
these callbacks to be received as the self pointer. By the time the
callback occurs, the address has been truncated to 32 bits; so, if the
TClientDataSet address will not fit in 32 bits, a corrupted pointer is
returned. An access violation is the best thing that can happen at that
point.

Other than the Midas problems preventing us from getting to 64 bits, we
have no regrets of using TClientDataSet with nested datasets and see no
alternative to replace it. FireDac has been suggested; but, our
research shows it to be inadequate.

William
Brent Rose

Posts: 126
Registered: 9/23/00
Re: CachedUpdates in 3 levels
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 20, 2016 1:29 AM   in response to: William Tucker in response to: William Tucker
OK - good to know about the 64bit problems. Thanks. I have not developed
much in 64 bit, so have not encountered these issues.

A shame that Embarcadero have let such important and fundamental
functionality "slip". It looks like before long there will be no data
access solution that works solidly in Delphi!!

How can that not be important Embarcadero??


On 20/12/2016 10:13 a.m., William Tucker wrote:

Brent Rose wrote:

This issue seems to get quietly buried somehow. It would be great to
know how other people are managing m/d data these days.

We are in the same boat; and, we have come to the same conclusions. We
are still using TClientDataSet because of nested datasets.

But, TClientDataSets also have some serious problems in 64 bits. Is
anyone else trying to use TClientDataSet in x64?

The problems come from the Midas library (which TClientDataSet uses as
its store). One of the problems has been fixed:
https://quality.embarcadero.com/browse/RSP-12470;
but, others remain:
https://quality.embarcadero.com/browse/RSP-14991?filter=12622.

The problems are caused by callbacks from Midas and the way
TClientDataSet uses them. TClientDataSet passes its own address to
these callbacks to be received as the self pointer. By the time the
callback occurs, the address has been truncated to 32 bits; so, if the
TClientDataSet address will not fit in 32 bits, a corrupted pointer is
returned. An access violation is the best thing that can happen at that
point.

Other than the Midas problems preventing us from getting to 64 bits, we
have no regrets of using TClientDataSet with nested datasets and see no
alternative to replace it. FireDac has been suggested; but, our
research shows it to be inadequate.

William
Brent Rose

Posts: 126
Registered: 9/23/00
Re: CachedUpdates in 3 levels
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 18, 2016 12:25 PM   in response to: Pablo Anizio in response to: Pablo Anizio
The other related shortcoming I should mention is that FireDAC uses
range-based master/detail links...

"Not since the BDE!!" is the comment that first comes to mind ;-)

There is the potential to combine it with parameter based links, sure,
but it's still basically range based... again, all related to the fact
that FireDAC does not support nested datasets. Trying to manage m/d data
with FireDAC is very frustrating (almost impossible) if you have ever
used TClientDataSet.


On 15/12/2016 2:33 a.m., Pablo Anizio wrote:

Can i work with firedac in cachedupdates mode with master/detail/subdetail? If yes, i need a little example.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02