This discussion is archived
1 Reply Latest reply: Sep 10, 2012 12:42 PM by Alex_Keh - Oracle_Product_Manager RSS

ODP.NET connection staying active in web application

921501 Newbie
Currently Being Moderated
I am using ODP.NET 11g (32-bit, 11.2.0.3.0) 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.

Questions:
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 - Oracle_Product_Manager Expert
    Currently Being Moderated
    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.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points