2 Replies Latest reply: Oct 8, 2008 11:57 PM by 664229 RSS

    cx_oracle ping (OCIPing) hangs when connection to server lost

    664229
      The cx_oracle ping function appears to be blocking and will wait forever when the connection to the database is broken but the socket still remains.

      we're running cx_oracle 4.4 on an Oracle 11.1 server with python 2.5, and have a remote client pushing data to the server across a flakey link.
      The basic structure of our python client is

      db = cx_Oracle.connect()
      while True:
      try:
      db.ping()
      cursor = cx_Oracle.Cursor(db)
      cursor.execute(query, params)
      except:
      print "DB error"

      so the socket pointer will be there which is checked in the ping command, so it will pass that, but then it will attempt to issue a ping to the server which is where it hangs forever.
      Any advice on the best way to get around this?