We're using pyodbc to connect to DB2 with Django hosted in a mod_wsgi container
in Apache. We sometimes get the exception 'Python type Decimal not supported.
param=1', 'HY097' which renders the whole web-app unusable.
I've dug somewhat into this, and I think the problem is that pyodbc is storing
a reference to the decimal class in import_types() in pyodbcmodule.cpp (I've
looked at 2.1.8). There's a good explanation in the context of psycopg2 here,
mod_python seems to have the same problem:
http://groups.google.com/group/webpy/msg/9f668fb9a549f759
Unfortunately, someone decided to break all the psycopg2 history and links, but
you can find the latest code here, the function is psyco_GetDecimalType:
https://dndg.it/cgi-bin/gitweb.cgi?p=public/psycopg2.git;a=blob;f=psycopg/psycop
gmodule.c;h=f91483df5ba214eb5fed7f855673e9736b9cc980;hb=HEAD
The gist seems to be to always load the module in case we're running in a
sub-interpreter instead of trying to cache it.
Original issue reported on code.google.com by olau%iol...@gtempaccount.com on 10 Feb 2011 at 11:43
Original issue reported on code.google.com by
olau%iol...@gtempaccount.com
on 10 Feb 2011 at 11:43