Is there any timeout for function cx_Oracle.connect(usr,pwd,host:port/service)?

Viewed 1702

I'm using cx_Oracle module to connect to Oracle DB. Is there any timeout for cx_Oracle.connect(usr,pwd,host:port/service)? If DB is down for some reason or if host is not reachable, then code is getting hanged at connect(), connect() method is taking very long time to return. Is there any way to get timeout issue ? any way to change cx_Oracle default timeout ?

import cx_Oracle
try:
    conn=cx_Oracle.connect('usr/pwd@host:port/service')
    print "Success"
    conn.close()
except Exception,e:
    print "Error:"
    print str(e)
1 Answers
Related