Urgent help req.How to close an Oracle connection when network gets disconnected
-
Hi all, In one of our project(Windows Servcice) we are facing an issue like After opening an Oracle Connection ,networks get disconnected before executing the finally block So not able to close the Oracle Session and the connection is in inactive state for long time untill we are killing it manually. Like this we have an inactive sessions of around 165. This makes the remaining applications getting down. So please any one kindly guide me to resolve this issue Thanks in advance try { OracleConnection con = new OracleConnection(); con.ConnectionString = "User Id=scb;Password=scb;Data Source=137;" con.Open(); } catch(Exception e) { } finally { con.Close(); OracleConnection.ClearPool(con); con.Dispose(); }
-
Hi all, In one of our project(Windows Servcice) we are facing an issue like After opening an Oracle Connection ,networks get disconnected before executing the finally block So not able to close the Oracle Session and the connection is in inactive state for long time untill we are killing it manually. Like this we have an inactive sessions of around 165. This makes the remaining applications getting down. So please any one kindly guide me to resolve this issue Thanks in advance try { OracleConnection con = new OracleConnection(); con.ConnectionString = "User Id=scb;Password=scb;Data Source=137;" con.Open(); } catch(Exception e) { } finally { con.Close(); OracleConnection.ClearPool(con); con.Dispose(); }
try { using(OracleConnection con = new OracleConnection()) { con.ConnectionString = "User Id=scb;Password=scb;Data Source=137;" con.Open(); . .. conn.close(); } } catch(Exception e) { } finally { con.Close(); OracleConnection.ClearPool(con); con.Dispose(); }