in reply to How to remove the warning: "there is already a transaction in progress" when using lock table

With AutoCommit => 0 you are already in a transaction. When you want to commit or rollback, do $dbh->commit() or $dbh->rollback(). Either of those implicitly starts a new transaction. Do not explicity execute "BEGIN WORK" or "COMMIT WORK".