6
votes

I've an application which has some controller's actions calling slow 3rd party web services. These actions are called using AJAX calls from the page.

I can use async controllers to free ASP.NET thread pool, that's great. But what about session? If I use InProc session and a request made to "slow action" the particular user can't make any request to the application because his session is locked by first "slow" call.

In PHP there is a method session_write_close() which I can use as following:

  1. Accept user's request to slow action
  2. Check rights of the user to access controller/action based on session data
  3. Write something to the session if needed
  4. Call session_write_close(). From this point session is closed by this request and any other request from the same user can access it
  5. Make my slow call (maybe in some async way)

I know that I can disable session state on the controller level using [SessionState] attribute, but that's not the solution.

Any ideas?

1
Why do you think that session is "locked" by any request?Serg Rogovtsev
Here are details: stackoverflow.com/questions/3666556/… and here another my question on the similar topic: stackoverflow.com/questions/2438493/…artvolk
Here is an ultimate description: stackoverflow.com/questions/3629709/…artvolk

1 Answers

1
votes

I think it could be several scenarios.

1) make changes in controller factory and change it to produce contorllers without session or with some custome session implementation

2) try to read this article about sessionless controllers