Problems with connection ping.

Roger Wenham <[email protected]>
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <[email protected]>
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



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.