MariaDB/InnoDB: What to do on "Locks in Status-Log but no locked table found"
You are right that the transaction is 'running' for several hours. This basically means you have a query that has failed to run 'commit' and is holding the transaction open.

If you are running in the default REPEATABLE READ transaction isolation level, you will also see your 'history list length' growing large in the TRANSACTION section of the SHOW ENGINE INNODB STATUS output

The lock status in SHOW OPEN TABLES, assuming you meant 'name_locked', is only for whether the name is locked for operations such as dropping or renaming the tables src

I am curious if SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS returns anything, especially if db1.table_a and db1.table_b are InnoDB tables. If they are MyISAM I would urge not using BEGIN TRANSACTION or SET autocommit=0, as you can run into some serious issues with potentially mixing InnoDB and MyISAM tables in a transaction.

Unfortunately, getting access to what that transaction has done is fairly impossible unless you're running the PERFROMANCE_SCHEMA to capture statemen. See: http://www.markleith.co.uk/2012/07/13/monitoring-processes-with-performance-schema-in-mysql-5-6/ Even still, it might not be possible for a transaction active that long depending on your server's activity and performance_schema settings.

So, you're really only left with the choice to kill the thread, which will rollback that transaction (again, assuming it's InnoDB tables being modified). Letting it run until it hits a timeout will result in the same rollback. And rollbacks might take a really long time, depending on what it's done!

I would scour the application's code-base to make sure you are closing/committing every transaction you are creating to prevent this in the future, as long-active transactions and an unruly history list length (undo space) can have a severe impact on the performance of your queries.