What is the proper way to check if we are in the middle of transaction in MySQL ?
I guess that using SELECT @@autocommit;
is not the way to go ?
also something like this:
SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX WHERE TRX_MYSQL_THREAD_ID = CONNECTION_ID();
found in this post, didn't work.