Reputation: 8376
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.
Upvotes: 4
Views: 854
Reputation: 107
You can try this too, as you're mentioning MySQL
my $threadId = $dbmyh->{ q{mysql_thread_id} };
Upvotes: 1
Reputation: 149823
You can use the CONNECTION_ID
function, e.g.:
my ($id) = $dbh->selectrow_array('SELECT CONNECTION_ID()');
Upvotes: 10