Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: Error on CachedUpdate in Combined mode


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 7 - Last Post: Dec 22, 2016 4:49 AM Last Post By: Pablo Anizio
Pablo Anizio

Posts: 10
Registered: 6/10/08
Error on CachedUpdate in Combined mode  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 15, 2016 11:29 AM
Step by step;

I have 2 FDQuery (master/Detail)

The detail query is in combined mode (Parameter and Range-based).

In detail dataset i have 2 rows.

I delete 1, ok, show in my dbgrid 1 line remaining.

When I try to delete the last one, after scroll the master, the dataset resets and shows the two deleted lines again.

This fact only occurs when in combined mode.

1) Another note: if shortly after deleting the last record, I insert another, then the behavior of the dataset returns to expected.

2) Another discovery: After deleting the records in detail, scroll the dataset master, then the dataset will show the deleted records, but if I apply the pending updates, the records will actually be deleted and only disappear from the dataset after calling the refresh (refresh only Can be called after the applyupdates).

In Range-based mode, works ok!

Example: [https://www.dropbox.com/s/jv1a1l5lgr40ynk/MD%20CombinedMode.rar?dl=1]

Is this happening to anyone else?

Edited by: Pablo Anizio on Dec 15, 2016 11:31 AM

Edited by: Pablo Anizio on Dec 16, 2016 3:53 AM

Edited by: Pablo Anizio on Dec 16, 2016 4:12 AM

Edited by: Pablo Anizio on Dec 16, 2016 10:46 AM

Edited by: Pablo Anizio on Dec 16, 2016 10:48 AM

Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Error on CachedUpdate in Combined mode  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 21, 2016 2:03 AM   in response to: Pablo Anizio in response to: Pablo Anizio
When I try to delete the last one, after scroll the master, the dataset resets and shows the two deleted lines again.
This fact only occurs when in combined mode.

Yes, it is. FireDAC thinks, that detail records were not yet fetched, when detail dataset is empty and there is parameter based setup.

1) Another note: if shortly after deleting the last record, I insert another, then the behavior of the dataset returns to expected.

See above. This is because detail dataset already is not empty and it does not refetch detail records.

2) Another discovery: After deleting the records in detail, scroll the dataset master, then the dataset will show the deleted records, but if I apply the pending updates, the records will actually be deleted and only disappear from the dataset after calling the refresh (refresh only Can be called after the applyupdates).

See above. This is because detail dataset is empty and it refetches detail records.

--
With best regards,
Dmitry
Pablo Anizio

Posts: 10
Registered: 6/10/08
Re: Error on CachedUpdate in Combined mode  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 21, 2016 3:58 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev wrote:
When I try to delete the last one, after scroll the master, the dataset resets and shows the two deleted lines again.
This fact only occurs when in combined mode.

Yes, it is. FireDAC thinks, that detail records were not yet fetched, when detail dataset is empty and there is parameter based setup.

1) Another note: if shortly after deleting the last record, I insert another, then the behavior of the dataset returns to expected.

See above. This is because detail dataset already is not empty and it does not refetch detail records.

2) Another discovery: After deleting the records in detail, scroll the dataset master, then the dataset will show the deleted records, but if I apply the pending updates, the records will actually be deleted and only disappear from the dataset after calling the refresh (refresh only Can be called after the applyupdates).

See above. This is because detail dataset is empty and it refetches detail records.

--
With best regards,
Dmitry

Hello, Dmitry, thanks for the answers.

But this is what you explained to me is the expected behavior or is it a Bug?

Edited by: Pablo Anizio on Dec 21, 2016 3:58 AM

Edited by: Pablo Anizio on Dec 21, 2016 3:59 AM

Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Error on CachedUpdate in Combined mode  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 21, 2016 4:12 AM   in response to: Pablo Anizio in response to: Pablo Anizio
But this is what you explained to me is the expected behavior or is it a Bug?

Expected behavior or design limitation - whatever you like more.

--
With best regards,
Dmitry
Pablo Anizio

Posts: 10
Registered: 6/10/08
Re: Error on CachedUpdate in Combined mode  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 21, 2016 4:30 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev wrote:
But this is what you explained to me is the expected behavior or is it a Bug?

Expected behavior or design limitation - whatever you like more.

--
With best regards,
Dmitry

Thanks again.

I would like to change this behavior ... I would like the dataset not to show the records marked as deleted. Can you tell me where I can change this in code?
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Error on CachedUpdate in Combined mode  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 21, 2016 5:12 AM   in response to: Pablo Anizio in response to: Pablo Anizio
I would like to change this behavior ... I would like the dataset not to show the records marked as deleted. Can you tell me where I can change this in code?

Use range based setup only.

--
With best regards,
Dmitry
Pablo Anizio

Posts: 10
Registered: 6/10/08
Re: Error on CachedUpdate in Combined mode  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 21, 2016 6:29 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev wrote:
I would like to change this behavior ... I would like the dataset not to show the records marked as deleted. Can you tell me where I can change this in code?

Use range based setup only.

--
With best regards,
Dmitry

In this mode, when the Detail Dataset has many records, it takes much longer to open than in the Parameter Based setup
Pablo Anizio

Posts: 10
Registered: 6/10/08
Re: Error on CachedUpdate in Combined mode  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 22, 2016 4:49 AM   in response to: Pablo Anizio in response to: Pablo Anizio
Dmitry Arefiev wrote:
This is because detail dataset is empty and it refetches detail records.

Where is made the check verification, before the refresh, to see if the dataset is empty?
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02