• Question

  • User1037616456 posted

    The performance of the application varies when you handle a Web service connection in Global.asax Session_Start open gate at the event and closed in the event Session_End? this webservice is instance static.

    thanks in advance

    Friday, April 29, 2011 10:29 AM

All replies

  • User1943143334 posted


    Yeah, it obviously varies, because, session_start is the event occurs, when the new session is starting, so if you try to connect to a webservice,it will take time to connect to the web service.

    Instead, try connecting to Web Service on demand. It will improve your web app performance.

    One more thing, Session_End event fires, only when the session state is set to "InProc", other than this, this event won't be fired. Try closing the web service connection as soon as you are done with it.

    Hope it helps u...



    Saturday, April 30, 2011 12:35 PM
  • User-481631678 posted

    Yes, performance will vary because you are adding extra piece of code in session_start/session_end which will slow down session creation process. However session_end process will remain unnoticable to user in most of the cases.

    Tuesday, May 3, 2011 4:23 AM
  • User-519136805 posted

    Definitely the performance will degrade, as you are trying to open the connection each time session start, Open the connection when ever needed and close it after using it. That is best way & gives you good performance. One more thing, why you want to open connection in session start event , is there any special requirement of doing so or anything else? Let us know the scenario why you want to do so. than it will be more clear to us.

    Hope this will help !!!


    Tuesday, May 3, 2011 9:23 AM
  • User1037616456 posted

    Hi guys.

    First of all, I'd appreciate your help with this existential question. This question is do I need to open and close the session from my webservice once, or at least possible. because my application makes many calls to the webservices by various methods, and I have many instances created for each method, so I wondered if you open and close the webservice in the global.asax in the session_start and Session_End events was correct, so I can keep in one instance all calls to each method of my webservice.


    thanks in advance

    Tuesday, May 3, 2011 7:14 PM