Master/detail,cached updates

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
spikija2
Posts: 2
Joined: Mon 07 Apr 2008 21:36

Master/detail,cached updates

Post by spikija2 » Mon 07 Apr 2008 22:01

Hello everyone!

I am evaluating ODAC with Oracle 11g on BDS 2006.

I'm interesting in master detail using cached updates.

In ODAC help says under master/detail:

Such MD relationship can be local and remote, depending on TCustomDADataSet.Options.LocalMasterDetail option. If this option is set to True, dataset uses local filtering for establishing master-detail relationship and does not refer to the server. Otherwise detail dataset performs query each time when record is selected in master dataset. Using local MD relationship can reduce server calls number and save server resources. It can be useful for slow connection. CachedUpdates mode can be used for detail dataset only for local MD relationship. Using local MD relationship is not recommended when detail table contains too many rows, because in remote MD relationship, only records that correspond to the current record in master dataset are fetched, that can decrease network traffic in some cases.


And under Cashed updated says :
When establishing master-detail relationship CachedUpdates property of detail dataset works properly only when TCustomDADataSet.Options.LocalMasterDetailis set to True.

My problem is that I need Master/Detail using cashed updates but without LocalMasterDetail on Detail table, because my Master table has 100 000 and more records, and detail has milions of records and using LocalMaster Detial is slow. Curently I set LocalMasterDetail to False and everything works OK.
What did You mean, by saying in help, that MasterDetail relationship CachedUpdates property WORKS PROPERLY only where LocalMasterDetail set to True.
What problems occurs when LMD is set to False, and why You must cache whole Detail records and not only those who matches primary key of Master table.

Is there any workaround for my solutions like manualy established MasterDetail using CachedUpdates?

Thanks for replay.

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

Post by Plash » Tue 08 Apr 2008 08:20

You can use CachedUpdates with LocalMasterDetail option set to False.
But in this case all changes in the detail dataset are lost if the master dataset is scrolled before the call to ApplyUpdates method.

spikija2
Posts: 2
Joined: Mon 07 Apr 2008 21:36

Post by spikija2 » Tue 08 Apr 2008 08:50

Thanks for your reply.

If that is only problem (issue) than it's ok for me and my problem.

Thanks.

-Sasa

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

Post by Plash » Wed 09 Apr 2008 06:43

Yes, this should be only problem.

Post Reply