[mod_python] Database Help

Sean Abrahams sa at sfsu.edu
Mon Jan 13 18:11:27 EST 2003


I'm implementing mod_python and everything is working fine, until I
try to pass an UPDATE sql statement to a database.

I'm grabbing info from one database, and inserting/updating into
another database.

When grabbing, I call upon my dbSelect(db, keys, sql, rows) function,
which connects to a specified database (db) and selects the info.
Works great.

To update/insert I call upon my dbDo(db, sql) function. This function
connects to the specified database (db) and runs the sql. Python wise
everything seems to work fine. I call the dbDo and nothing appears to
go wrong. Except when I look at the data in the db, it wasn't updated.

All of this works fine from the interpreter, so I'm thinking it may
deal with the way mod_python handles processes and dbconnections, of
which I know very little of.

Thus, does connecting to two different databases, right after one
another, cause a problem in mod_python? I'm supposing I must change my
dbConnect() function to take this into consideration due to the way
mod_python/apache function.

Some ideas? I want to learn!

Thanks,
--Sean

Running:
Apache/2.0.43 (Debian GNU/Linux) DAV/2 mod_python/3.0.1 Python/2.2.1
cx_Oracle




More information about the Mod_python mailing list