Debugging Web Service with database connection saved in Application session state variable

I'm debugging a web service app that has a database connection stored in an application session state variable.

When I finish a debugging session and then start a new one the database connection object still exists in the application variable from the previous debug session.

Is there a way I can clean up objects stored in application variables before I start a new debugging session

Thanks



Answer this question

Debugging Web Service with database connection saved in Application session state variable

  • shido

    Mike,

    First of all, why do you need the connection object to be in a application session variable

    Then, your assumption may be right.... after using the connection object you can't forget closing it.... remember to use a try, catch, finally block (don't forget the "finally") in order to make sure that connections don't keep alive after they are not longer needed.

    Rgds

    Rodrigo


  • Prabagarane

    I think I know what's going on.

    I don't have exception handling in place yet.

    So when the app bombs the connection is still open (no try/catch/finally code yet to close the connection!!!). Thus when I start another debug session the previous DB connection is still open and I try to open it again, a no no.

    If anyone thinks something else is going on let me know.

    Thanks,

    Mike


  • Debugging Web Service with database connection saved in Application session state variable