I am running into an issue that I am hoping someone can confirm as expected or unexpected behavior and possible solutions. My environment is SL5 and CSLA 4.3.10. Here is a typical scenerio I am running into:
After by main BO is loaded, I use either a CommandBase or ROB to load an additional list of transactions. This secondary Execute or Fetch operation may take 10-20 seconds (may need to communicate with 3rd party system etc) so I want the user to be able to start working right away before this finishes. This basically works fine. However, if the user does something to initiate another DataPortal operation, that operation will block until the long-running Execute/Fetch is finished. The block seems to occur with the WCF DataPortal call at the web server. If I change the IIS application pool to run multiple Worker Processes (eg web garden), then no blocking occurs provided there are enough worker processes to handle concurrent requests from one user session.
I am wondering if this behavior is expected and if so, do others that run into it simply use Multiple Worker Processes or something else to resolve. It seems that a longer running lazy loading scenerio would exhibit the same type of behavior so I am guessing others have had to work with this.
Any thoughts would be appreciated!
Ok, so I figured out that ASP.NET SessionState is the culprit here, and I suppose that makes sense. I am thinking I don't need ASP.NET sessions for SL or CSLA. Can anyone else comment on whether they turn this off to allow concurrent requests to the server? Or are there other options (like multiple Worker Processes) that would be a better choice?
I am going to play with this some more but any comments would be appreciated.
I have went with setting sessionState="Off" in web.config and this effectively solves the issue. Now, all server requests run concurrent so longer-running requests aren't blocking other server requests made by the same user session.
Normally session isn't loaded in a WCF host project. But if your web site is configured to use session (and YOU aren't using session in your code) then you should turn it off. The data portal doesn't use it.
Thanks Rocky for that confirmation.
Copyright (c) Marimer LLC