[cx-oracle-users] Problems with connection ping.
Brought to you by:
atuining
From: Roger W. <rog...@to...> - 2013-07-09 14:01:24
|
Hi, we have been using cx_Oracle for quite a while and have recently re-compiled with cx_Oracle 5.1.2 and Oracle 11g, and now have a problem with connection.ping() always returning False. Ping is used to check if the connection is OK during error recovery... The gist of the code is this: try: if hasattr(self._connection, "ping"): if self._connection.ping(): return True else: return False else: if not hasattr(self._connection, "cursor"): if not self._getCursor(): return False self._connection.cursor().execute("select now from dual") return True except Exception, e: ... The code finds that the database connection has an attribute ping, but calling it always returns an object that evaluates as False. If I force the routine to use the second method if checking the connection (using SQL) it always works. This code worked OK with a previous version using oracle 10... I have fixed the problem by forcing the code not to use ping, but it would be nice to get to the bottom of this... Is anyone else experiencing this??? Thanks in advance.. Roger |