When updating the lock stats table, inside a transaction which is then rolled back we end up with the stats being rolled back too. In almost all cases we are not inside a transaction, but detect when we are an open a second db connection.
Tasks in order:
[ ] make a central db helper with a pointer to $DB
[ ] rewrite all the sql to use this (except the upgrade script)
[ ] when we any db call involving the _locks table (not history) a new help method like 'check_transaction. If we are then clone the existing $DB config and open a new connection update out pointer
[ ] investigate and test any interaction with the read slave plugin
When updating the lock stats table, inside a transaction which is then rolled back we end up with the stats being rolled back too. In almost all cases we are not inside a transaction, but detect when we are an open a second db connection.
Tasks in order: