I have a system which does error logging to its database:
db = MySQLdb.connect(...) # get database connection
The problem is that I want errorlog to commit its message to
the table used for error logging, but don't want to commit
whatever the caller was doing - that may well revert.
MySQL doesn't support nested transactions, so that won't help.
At the many points errorlog is called, only the database
handle is available, not the params used for "connect".
Is there something like UNIX "dup" for database connections
in MySQLdb, or can I get the connection parameters (username,
password, database, etc.) from the "db" object?
Grokbase › Groups › Python › python-list › September 2010