n = mysql::ThreadId(dbh)
Returns the thread ID of the current connection. This value can be used as an argument to mysq::Kill() to kill the thread.
If the connection is lost and you reconnect with mysql::Ping(), the thread ID will change. This means you should not get the thread ID and store it for later. You should get it when you need it.