I am new to ASP.NET. I have a MVC web application accessing data from three tables in SQL Server. I have a requirement where if one user is editing data from one table then other users should not be allowed to edit any data. I have tried using a table in SQL Server with a flag for editing which set and reset based on user activity. But this doesn't seem to be reliable. Can someone suggest a better option to achieve this.
Lock all tables for editing for all other users when one user is editing data (in SQL Server) in asp.net
251 Views Asked by ajay At
1
There are 1 best solutions below
Related Questions in C#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in ASP.NET-MVC
- I have a problem outputing the roles on the page ListRoles.cshtml
- Dropdown list showing SQLServer2005SQLBrowserUser$DONSERVER instead of Active Directory group name in ASP.NET MVC C#
- Hosting ASP.NET MVC application on IIS web server using Windows 2019 server
- How to display only department fields associated with a selected department in student automation system?
- How to send select input data for form submission?
- Multi level project reference using dll
- How to upload file to Onedrive using ASP.NET MVC?
- ASP.NET MVC web app looping between fields only on some devices
- Is there any automatic job to load AD-groups?
- How to restrict admin js files to download
- Download PDF in ASP.NET MVC application
- How to add bootstrap theme/example into ASP.NET MVC 5?
- Web API works with Windows authentication enabled when consumed via Swagger but throws an unauthorized issue when accessed through web app
- ASP.Net Core 7.0 Web App (Model-View-Controller) ErrorViewModel OnGet OnPost do not get called or executed
- OAuth 2.0 keep getting Authorization has been denied for this request
Related Questions in ASP.NET-CORE
- Windows environment variables at appsettings.json
- Which approach is right while creating a service for your update method?
- New Blazor Web App, Password Reset "A valid antiforgery token was not provided"
- No webpage was found for the web address: https://localhost:7002/Category/Add?area=Admin. Why is my URL generated like ?area=Admin instead of /Admin/
- how to get the html for a tag helper in code
- How to share authorization implemented in the server project with the client project in Blazor Web App Auto project?
- Why https is disabled on publish in .NET Core 7.0
- How to set language in a server-side rendering blazor app
- How can I debug server side rendering blazor code in a component?
- ASP.NET Core 6 randomly returning 200 with empty response
- ASP.NET Core MVC : NullReferenceException: Object reference not set to an instance of an object
- ASP.NET Core Identity Custom Register Endpoint
- VS Community 2022 cannot install dotnet-ef when i try to publish
- How does ASP.NET Core Identity ensure username is unique under concurrent conditions?
- In clean architecture, is the presentation layer allowed to communicate directly with the infrastructure layer?
Related Questions in PESSIMISTIC-LOCKING
- How can I exclude reading rows that were selected in the first transaction when executing the second transaction in PostgreSQL?
- Spring Data JDBC and LockTypes: PESSIMISTIC_WRITE vs PESSIMISTIC_READ
- Pessimistic Locking in Spring Data JDBC
- Conflict handling for write operations during pessimistic lock transaction in Firestore
- How to run Firestore server-side pessimistic lock transactions in a project using Dart
- UCP Oracle Hibernate Pessimistic Locking
- Getting "org.hibernate.PessimisticLockException: could not execute statement"
- How to optimize query if it uses Pessimistic Write Lock
- Optimistic and Pessimistic Locking in JPA vs Isolation level
- When will the PESSIMISTIC READ lock be released if we use it within nested transaction?
- Spring Data @lock(lockmodetype.pessimistic_write) not working as well
- Why Spring Data JPA Pessimistic lock not working as expected?
- Generate sequence number without gaps by multiple app instances
- How to unlock @Lock(LockModeType.PESSIMISTIC_WRITE) if there is no transaction
- Lock all tables for editing for all other users when one user is editing data (in SQL Server) in asp.net
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I believe there might be a better way to handle the whole situation you are in, but a suggestion would be that instead of a flag, you would have a
datetimecolumn that holds a lock expiration time. When reading the record, if the current time is prior to the expiration, the form wouldn't load. If the current time is after the expiration; read the data, load the form, and update the expiration in a serializable transaction. Finally, when a user completes there update set the expiration to the current time. This way, an error in updating the flag wouldn't hold a lock on the records indefinitely.