Web Connection
New data is not always saved
Gravatar is a globally recognized avatar based on your email address. New data is not always saved
  Luca
  All
  Feb 27, 2017 @ 01:29am

Dear Rick,
I have WC 6.05 and use it in standard way to save data (Business object) and sometime with some REPLACE.
A customer complains that sometime he clicks on save button and reloading the webpage he discovers new data has not been saved.
For example he add mobile number on an already existing record, but the new data is not saved on table as if his browser does not transmit new data on server.
Unfortunately this happens only sometime, on different webpages and on different office's machines.
I believe the problem is not in my software, I do believe Business object works always right, so how to prevent this problem?
Maybe reindexing tables every night?

Thank you very much for any suggestion.

Gravatar is a globally recognized avatar based on your email address. re: New data is not always saved
  Harvey Mushman
  Luca
  Feb 27, 2017 @ 07:35am

For starters, I have never found the problem to be with index. But I'm assuming you are using VFP9 and not dBase III... lol

What sort of Web Connection application is this, original framework where VFP generates the HTML page on the server or an RESTProcess site where the HTML is populated with Async callbacks in the background? Are you doing JQuery or some other sort of background callbacks where the client page is refreshed on the response and not repainted.

I wonder if the client hit to save the data is hitting the server? Do they have any sort of visual feedback?

I have on all of my pages a DisplayMessage html element that has an blank value until the server responds with a result from a user action. In this case the message would be "Saved". Then using a small peice of JavaScript $timeout resets the value back to a blank string after 1000ms.

I guess you need to isolate your problem down to which page and the value that is not getting saved.

This makes me wonder because you talked about indexing... when your client comments that the error occured, without them doing a second save or any other work have you looked at your tables to see if the data is there? I ask this because as you said you are using both wwBusiness and Replace in your code. Maybe your replace is working but cache is not getting written. I know wwBusiness does not have a problem with flushing cache but maybe the way you are doing your REPLACE in combination with wwBusiness is causing some data to not be written.

Need more details and perhaps code to really be helpful - guessing in the dark.

Gravatar is a globally recognized avatar based on your email address. re: New data is not always saved
  Luca
  Harvey Mushman
  Feb 27, 2017 @ 10:24pm

Dear Harvey,
it is a standard Web Connection written with VFP9 (framework where VFP generates the HTML page on the server) there are no Async/JQuery callbacks in the background.
The saving process hits certainly the server, because there is a Response.Redirect to reload the webpage and it is at this time customer sees data not saved.
The wwBusiness saving event occurs before the little Replace and data not saved is always competence of wwBusiness object because of the RecordSource.
I did think to indexes because the problem occurs only sometime, randomly, so I suspect a slowness by the database.
This week I am reindexing manually every night so to see if the problem disappears.
Sincerely

© 1996-2024