But, that is not a viable solution for our particular application context. It seems like the above query might be helpful if I was continually polling the database in order to gather insights. However, what I discovered in my testing is that, by the time we see the Deadlock found when trying to get lock error, the lock information about the given query is already gone from the above result-set. ( b.trx_mysql_thread_id ) AS blocking_thread,Īt first, I thought I might be able to run this query when a Transaction deadlock appears in the ColdFusion application. ( r.trx_mysql_thread_id ) AS waiting_thread, Their docs even provide a SQL statement that shows which transactions are blocking and which are waiting: When I started to read-up on how I might get some better insight, I was excited to see that the MySQL performance schema actually provides insight into Transaction and Locking information. I vaguely understand that a deadlock revolves around concurrent access to a single record but, my understanding goes no deeper than that, really. ![]() To be honest, as much as I love SQL databases, I have a rather poor understanding of how Transactions work and, about what conditions actually lead to deadlocks. When we were executing our ColdFusion code, this is the MySQL error was showing up in our logs:ĭeadlock found when trying to get lock try restarting transaction. However, I still have no idea what that was happening so, I wanted to see if I could find a way to get better logging around MySQL deadlocks in our Lucee CFML 5.2.9.40 application. Eventually - after may page refreshes - the page finally executed successfully. However, when we looked at the SQL statement that was failing to obtain the lock, it was a complete mystery (at least to us) as to why that SQL statement was consistently running into the locking problem. ![]() The other day, Josh Siok and I were running into a strange problem: we were executing a ColdFusion page that was immediately terminating in a Transaction Deadlock error in MySQL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |