Obscure MySQLdb question - duplicating a database handle
nagle at animats.com
Thu Sep 2 23:07:38 CEST 2010
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?
More information about the Python-list