Switching Between InProc and SQL Server Session State

Discussion in 'ASP.NET / ASP.NET Core' started by nlk10010, Sep 11, 2012.

  1. I originally tried InProc SessionState, then had the SQL Server SessionState objects added to my database (in an effort to debug a persistent Authorization problem).

    Is it possible to switch back to InProc by just changing my Web.Config, effectively ignoring the SQL Server SessionState structure? Or do I have to have those objects removed in order for InProc to work correctly?

    Thanks for any info.
     
  2. Hi nlk10010,

    As you may have seen on another thread, I am thinking of switching from InProc to SQL Server to store session state.
    Can you share your experience? What worked well? Was it noticeably slower?

    And I'm no expert by any means(!!!), but my understanding is that if you change your web.config file back to its former sessionState mode="InProc", you should be back to InProc.

    Thanks
    MarcusT
     
  3. dmitri

    dmitri DiscountASP.NET Staff

    Switching back to InProc in web.config should be enough and you will need to uninstalled SQL Schema objects in your database.
     
  4. Dmitri:

    Is that (uninstalling the SQL schema objects) something we can do or do we need to submit a ticket to support?
     
  5. Well I'm unfortunately beyond frustrated with this. SQL Server session state hasn't solved the issue; rather, it's made some processes non-functional, but I don't think it's the cause of my original issue.

    I've added a machine key to my web.config, switched to SQL Server sessionstate and I STILL get random, frequent redirections back to my Home page. I've tried all sorts of logging/tracing and debugging "tricks" and can't figure out what's going on. At first I thought it was Authentication expiring but I changed things to allow Anonymous Access to all my controllers and I STILL get it. Session variables seem to disappear as well. But this is triggered simply by going from one controller to another in a span of no more than 5-10 seconds.

    I've visited other "low cost" web hosts and seen similar issues raised in their forums (frankly, it looks like most of these companies are owned by the same people, they just create a bunch of different names). Some people don't have the "random redirection" problem, some do.

    I tried GoDaddy originally but they don't allow Full Trust so I thought I'd try here, but I may need to see if spending some more a month would eliminate the issue. As I said, I had no issues like this on Azure, so I have a feeling it's not essentially a problem with my app.

    In short, you can try SQL Server sessionstate: I don't think it will hurt things (although it did a bit in my case) but I think there's a good chance it won't help, either.

    If I get any more info I'll be sure to share it.

    Good Luck.
     
  6. Hi nlk10010,

    Ugh... sorry to hear that. Sounds like a nightmare.

    You mentioned in the other thread that you were going to submit a ticket to see if there's been recycling. Did you find out if that was the cause?

    I ask because I was having a similar problem (users being logged off) which I now believe is due to exceeding the memory limit and the app pool recycling.

    Also, did you find the switch from InProc to SQL Server session slowed things down?

    Good luck with your application!
     
  7. I did and got a relatively speedy response to the effect that my App Pool was experiencing multiple recycles. This convinced me that, for whatever reason(s), my app was not going to run successfully on DiscountASP.Net servers.

    Honestly, the app never ran for more than 10-20 seconds, so I really couldn't tell, sorry. As I mentioned, I did have to mark one of my classes Serializable to avoid throwing an exception, but that was understandable. I can't say whether the switch also caused some mysterious issues that cropped up afterwards. But speed? It's supposed to be slower, of course, but I had no way of telling.

    Thanks, fortunately DiscountASP.NET offers a 30 day money-back guarantee, of which I was forced to take advantage. I'll try something different.

    Good luck to you as well.
     
  8. Hi Dmitri,
    i confused.. In my case i have one database with session state configured with one application. now i created one more application(same functionality). i want to use same database for session state for both application.

    my old application running in sql session sate mode. new one is running in Inproc mode. Now i want to switch my new application to sql session mode.

    How is it possible, have any other way to accomplish this without change the schema.??

    Thanks in advance
    John.
     

Share This Page