[DB-SIG] DCOracle2 excepting after execute

Andy Todd andy47 at halfcooked.com
Thu Jun 12 10:50:36 EDT 2003

Kancianic, Jennifer C. (JKANCIAN) wrote:

> Sometimes, when our code executes an update or insert statement, DCOracle2
> will except unexpectedly.  Here is the traceback from our logfile:
> Traceback (most recent call last):
>   File "/home/adc/adc/lib/UserDB.py", line 414, in updateLastAccessed
>     results = self.db.doSQL(sql, (key, ))
>   File "/home/adc/adc/lib/OracleDB.py", line 111, in doSQL
>     self.cursor.execute(sqlStatement, list)
>   File "/usr/local/lib/python2.2/site-packages/DCOracle2/DCOracle2.py", line
> 1008, in execute
>     self.rowcount = self._cursor.rowcount()
> AttributeError: 'NoneType' object has no attribute 'rowcount'
> This appears to be occurring in the DCOracle2 code that tries to get the
> number of rows affected after the execution.
>         result = self._cursor.execute()
>         if result in RowCountResults:
>             self.rowcount = self._cursor.rowcount()
>         else:
>             self.rowcount = -1
> Has anyone encountered this?  What can I do anything to NOT get the
> exception?  This is happening regularly and is not good.
> If this was designed this way, how should I deal with it?  Forgive my
> ignorance.
> I am using Oracle 1.8, Linux Redhat 7.1, python 2.2, DCOracle 1.3 (I think).
> Thanks for your help,
> Jenny
> _______________________________________________
> DB-SIG maillist  -  DB-SIG at python.org
> http://mail.python.org/mailman/listinfo/db-sig

It possibly is a bug, but it is a little hard to tell without looking at 
all of the code. Can you produce a nice simple example that causes the 
same exception to be raised? Or can you strip the SQL from the your 
example and tell us what happens when you run it in SQL*Plus?

I haven't come across a situation where a DCOracle2 cursor object 
doesn't have a rowcount attribute, but that may just be me. Also, are 
you sure about the versions of the software you are using? Oracle 
doesn't currently ship a version 1.8, is it perhaps 8.1?

 From the desk of Andrew J Todd esq - http://www.halfcooked.com/

More information about the DB-SIG mailing list