My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 156: Decimal support is not multiple-interpreter safe (mod_python, mod_wsgi)
3 people starred this issue and may be notified of changes. Back to list
Status:  Investigating
Owner:  ----


 
Reported by olau%iol...@gtempaccount.com, Feb 10, 2011
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/psycopgmodule.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.
Feb 27, 2011
Project Member #1 mkleehammer
(No comment was entered for this change.)
Status: Investigating

Powered by Google Project Hosting