0

I want a trigger on a table to fail if a transaction isn't active. I've tried to used the autocommit variable, but it apparently isn't affected by START TRANSACTION so it will in my case always be 1 anyway. I want to do something like:

IF ![transaction check] THEN
      SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Transaction must be active';
END IF;

How can I do this?

Atle
  • 1,867
  • 12
  • 10

1 Answers1

0

You can check for table locks with SHOW PROCESSLIST

Parris Varney
  • 11,320
  • 12
  • 47
  • 76