1 Reply Latest reply on Sep 10, 2012 7:42 PM by Alex Keh - Product Manager-Oracle

    ODP.NET connection staying active in web application

      I am using ODP.NET 11g (32-bit, to connect to a third party DB with a web app running on IIS7. Occasionally (once a week or so) the connection will remain active indefinitely forcing me to restart the server. When I run the performance counters, I can see it happening in the NumberOfActiveConnections and NumberOfActiveConnectionPools. I am running all of the traces, but I don't see any obvious errors occurring.

      1. How can I restart the driver without doing a complete restart of the server? I've tried restarting IIS, the WWW Publishing Service, and the application pool, but it doesn't affect the connection.

      2. What should I be looking for in the trace files to figure out why this is happening?
        • 1. Re: ODP.NET connection staying active in web application
          Alex Keh - Product Manager-Oracle
          You can call OracleConnection.ClearPool or ClearAllPools to reset the connection pool without restarting the driver.

          I'm not sure if the trace file would help you diagnose. It's not an error to have a connection indefinitely open per se. If no errors are being thrown, tracing will be of limited help.

          I assume you are disposing all your OracleConnection objects explicitly. Is it possible some corner case occurs where Dispose isn't called, such as a corner case or a procedure that exits abnormally? Could it be possible that the DB is getting bounced on occasion and the app doesn't exit, but continue to hold onto the "dead" connection? I can't really answer these questions without knowing how your app handles these scenarios.