I faced the issue after my code is uploaded into server, Problem is When accessing static data table by multiple users at a time the data is getting merged i.e In my case, I'm using static data table for file Upload. Lets consider 2 users trying to upload different documents from different locations. Here problem is data table holds the those users document in a single data table rather than creating new instance for each user.
Asked
Active
Viewed 163 times
0
-
1One solution is not to use static. Create a singleton instance so each user has his/her own data table. – jegtugado Jul 26 '16 at 04:45
-
1What is this ? Web API ? Show how and where you're defining your `DataTable` and how you're accessing it. This is incomplete and unclear. – Zein Makki Jul 26 '16 at 04:45
-
We are here to help you solve your issues. Rather then completely answering and writing code for you. Please let us us know what efforts have you put to do this. – Nehal Jul 26 '16 at 04:51
1 Answers
1
If you define a variable as static, then it will get the application scope, which means the variable is shared with all users who accessing the application(doesn't matter if the users are from different system, or having different sessions or browsers). The code you already having is an example for this;
What you can do in this scenario is that:
Maintain the DataTable in session, so it will be instantiated for each user. if you want to access it in a number of pages, or else declare the DataTable in the page itself. Here you can find detailed Explanation with Example

Community
- 1
- 1

sujith karivelil
- 28,671
- 6
- 55
- 88
-
1Thanks for your help. It was really helped me to solve my issue. – Daniel A Sathish Kumar Jul 26 '16 at 06:05