Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have more than 100 users working at the same time throughout the country.
There are isolated scenarion wherein when they save the record, it saved the old information of other users.

I want to have a initialization stage on page load wherein all cache on page will be removed so it will start as new and to avoid getting old data saved into the database.

Please help on what is the best practice or approach. Reaelly tired of this problem though its isolated but problem occurs on critical data.

One more is there any draw back or cons if I implement this?

Regards
Dabsukol
Posted

Could it be more along these lines....?

User 1 and User 2 both want to work on the same record

* User 1 enters the page and begins changing data.
* Before User 1 has submitted any changes, User 2 also enters the page and starts amending data
* User 1 submits changes, updating the database record.
* User 2 at this point *is unaware that the record has been updated*.
* User 2 submits changes. User 2 will overwrite Users 1's changes with whatever the values were when Users 1 & 2 both started working on the page, and whatever changes User 2 made.

This is a concurrency issue rather than a caching issue, there are lots of different ways of handling this. Have a read through some of these links, or Google

http://www.codeguru.com/csharp/.net/net_data/article.php/c19655/Handling-Concurrency-Issues-in-NET.htm[^]

http://msdn.microsoft.com/en-us/magazine/cc163924.aspx[^]
 
Share this answer
 
Comments
dabuskol 15-Oct-12 5:45am    
Thanks Dylan,

That is my first impression but I believe I was able to solve it.
I ask one user to create a new request from our our satellite office and every time he creates it saves a record he always lost his one becuase data is overwritten by old information.
I ask for his login information and do the same in my pc and it works well, I ask him again to do the same using the same link and application and he still encounter the same problem. I told him use the IP address instead of the normal weblink and it works.

Another solution that I gave is to open an IE then click Shift-control-Del then mark the temp internet lnik, form data, cookies and click delete before creating a new request.

Out of 100 or more request I encounter this problem.
Saving is done thru SP to all tables.

Regards
Dabsukol
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
Response.Cache.SetExpires(DateTime.MinValue);


put this code in master page.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900