I am trying to understand, do my modules share DBI connection to MySQL or no. I'd like to determine their connection ID. There may be better solutions (and i'd like to know them), but first question is still about knowing connection ID.
You can use the CONNECTION_ID
function, e.g.:
my ($id) = $dbh->selectrow_array('SELECT CONNECTION_ID()');
You can try this too, as you're mentioning MySQL
my $threadId = $dbmyh->{ q{mysql_thread_id} };
From DBD::mysql documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With