Asp.Net Concurrent Requests and exclusive lock

Just a problem faced in asp.net using MVC architecture. I was suppose to open popup window to send email from a webpage. It was working fine, however I wanted to do not wait till popup complete sending email function and user can work on another tasks in main parent window. However it was not working and I have to wait till child finishes sending email.

So I was trying to execute concurrent requiests, however session was not permitting to do it. If two different users make concurrent requests to access separate session is achievaable. But if I am trying two concurrent requests for the same session by using same sessionid, it was waiting till first request is finished and vice-versa. So it was adding exclusive lock on the information is freed becaus the first request exceeds the lock time-out.

However I wanted to provide such a functionality in my website, I searched and found a solution. To resolve this issue we need to set EnableSessionState value in the @Page directive to Read-only, means a request for the read-only session information does not result in an exclusive lock on Session data. But read-only requests for session data may still have to wait for a lock set by a read-write request for session to clear.

This was one good setting we have learned in asp.net. Hope it will be helpful to others too. You can read more about ASP.Net Session State on: ASP.NET Session State Overview

Advertisements

About Vijay Modi

Having 12+ years of experience in web application development. Expertise in various domains like E-Commerce, E-Learning, Insurance. I have expertise in web application development, window application development, Performance improvement, bug fixing etc. I have worked on various Microsoft technologies including ASP.Net, MVC, WebApi, WCF, Entity Framework, WPF, Window Application Development, AWS, Azure, AngularJS 2.0 / 1.5.2, .NetCore framework, jQuery. I am believing in quality work and achieving deadlines. Also like to work on new technologies and quick learner.
This entry was posted in ASP.Net. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s