Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Urgent help req.How to close an Oracle connection when network gets disconnected

Urgent help req.How to close an Oracle connection when network gets disconnected

Scheduled Pinned Locked Moved C#
helptutorialoraclesysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ravindradonkada
    wrote on last edited by
    #1

    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(); }

    R 1 Reply Last reply
    0
    • R ravindradonkada

      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(); }

      R Offline
      R Offline
      Richard Wray
      wrote on last edited by
      #2

      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(); }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups