I created a very simple CRUD application using WebClientDataset and WebClientConnection.
All is well: I can update, delete and insert records. In the AfterPost and the AfterDelete I do:
TAwait.ExecP(WebClientDataset1.ApplyUpdatesAsync);
However: If I do two operations on the same record: from the second operation nothing seems to be applied (I don't see any calls to the server).
If, in between the two update operations I do a refresh of the WebClientDataset then it works. But I don't want to refresh the entire dataset just because of this.
What am I doing wrong ?
Thanks
Wim, did you try this syntax for the AppyUpdatesAsync
call?
TAwait.ExecP<Boolean>(WebClientDataset1.ApplyUpdatesAsync);
Hi Terry,
I tried both this new syntax as well as the old one (just the .ApplyUpdates). Both have the same result.
Is the REST server supposed to send back specific headers or data after an operation ?
What I am currently doing is that the REST server sends a status = 200 back together with a JSON object with the inserted or updated record.
Is there any demo application with TWebClientDataset/TWebClientConnection that does more than just fetching the data (but full CRUD operations), so I could have a look what the differences are ?
Thanks
Wim, I'm not the expert on REST server. I only suggested adding the part of the new syntax because I had seen that omitting it seemed to thwart the "await" delay in some other cases.
Anyone having any idea, or having an example ? I'm stuck on this.
Thanks
I ran the exact same code on Web Core 2.5.0 and there it seems to work.
Could it be a bug introduced in v2.6.0 ?
What exact code do you use that is doing 2 times an update on a record and from where exactly do you call it 2 times? Do you wait for the 2nd call for the first to finish?
And fwiw, v2.5.0.0 does not have ApplyUpdatesAsync.
Hi Bruno,
I had the issue in v2.6.0 also in the ApplyUpdates (I tried it all), so for v2.5.0 I also used the ApplyUpdates.
I gave ample of time between the two calls
How I went about:
- I have a grid and a navigator and 2 DBEdit's
- I start editing a record in the DBEdit's and post the record by clicking on the post button of the navigator
- The Afterpost does an ApplyUpdates -> I can see this launches a request to the REST server
- I repeat from step 2 (on the same record) -> ApplyUpdates is not launching anything to the server anymore
Actually these details do not seem relevant as I also tried to do an ApplyUpdates in the OnClick of a button, use different buttons to do the POST etc -> all had the same result: the first time a record is updated and applied to the server it works, from the second time (for the same row): nothing sent to the server.
If in between I refresh the WebClientDataset, it works
If needed I can put my REST server online (it is currently only a test with fake data) and provide you with the simple client code, so you can have a look if this is not something you can reproduce.
We did not change anything to the ApplyUpdates implementation.
If you can create a sample source project with which we can test this, then we can investigate
Hi Bruno,
I just checked: you have the same issue on the SQLDBBridge project of the demos.
Log in with Bruno/tms and update any existing record and after the update do an apply updates -> there is a PUT request
Then change the same record, post and apply updates -> no issue being sent to the server.
This is in v2.6.x. In v2.5.0 it does work.
Some small corrections (I am too late to edit it):
"you have the same issue" -> "I have the same issue"
"Then change the same record, post and apply updates, no issue being sent to the server." -> "no request being sent to the server."
We traced & solved this issue. Next update will address this.
1 Like
Solved in 2.6.1.2 (released today). Thanks !
1 Like