Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with cx_Oracle.execute()

813954Nov 13 2010 — edited Nov 15 2010
Hi, everybody!
I've encountered the following problem while using cx_Oracle extension for my Python programme: method cx_Oracle.execute() hangs with no response or errors in case of sudden loss of net connection. Here is my special simple code for testing this bug:

import cx_Oracle
connstr = raw_input('connstr:') # in a form of 'user/passwd@host'
con = cx_Oracle.connect(connstr)
cursor = con.cursor()
query = raw_input('query:') # Let's print query (for example 'select * from table1'), then switch the internet connection off and push Enter
cursor.execute(query) # here it hangs
print 'Here' # it won't be printed
res = cursor.fetchall()
print res

In presence of the Internet? all's OK.
by the way, MySQLdb - a python extension for MySQL databases rises operational error in such case ( mysqlexceptions.OperationalError: (2006, 'MySQL server has gone away')), which might be easily processed.
If it helps: I've got Linux Fedora 14, Python 2.7, cx_Oracle-5.0.4
Please help if possible.
Thanx in advance!
Yury.

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 13 2010
Added on Nov 13 2010
1 comment
2,941 views