Last post Jul 16, 2018 08:13 PM by mudassarkhan
Jul 11, 2018 10:20 PM|gapi555|LINK
I have an application that allows users to create a web page based on the template that he/she chooses. I have lots of template data stored in JSON files which I plan to use to populate the body of a web page via AJAX call.
I know that if I store the template data in a database I will not face the DeadLock issue as SQL server have built-in features to handle simultaneous data access. However, suppose I use JSON files to store the template data as I had planned, will simulatneous
access of these files by multiple users cause a deadlock or a crash?
Jul 12, 2018 09:28 AM|Yohann Lu|LINK
However, suppose I use JSON files to store the template data as I had planned, will simulatneous access of these files by multiple users cause a deadlock or a crash?
You can try to use the lock Statement (C# Reference)
The lock keyword marks a statement block as a critical section by obtaining the mutual-exclusion lock for a given object, executing a statement, and then releasing the lock. The following example includes a lock statement.
and Asynchronous programming with async and await (C#) in asp.net to avoid activities
that are potentially blocking.
Jul 16, 2018 12:12 PM|PatriceSc|LINK
You shouldn't have any issue if you are just reading those template files. I would suggest to always start from what actually happens. You add ASPX files to your web app? It would cause the application to restart. Which kind of "crash" or "deadlock" behaviour
do you see ???
Jul 16, 2018 08:13 PM|mudassarkhan|LINK
Database is always better than File. With File even if you use the best Lock mechanism. There will arise a case when you will have a corrupt file with two processes trying to access.
Plus the operations you can do in DB will not be present in case of File.