2 Replies Latest reply on Oct 9, 2008 4:57 AM by 664229

    cx_oracle ping (OCIPing) hangs when connection to server lost

      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:
      cursor = cx_Oracle.Cursor(db)
      cursor.execute(query, params)
      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?