Database to perform the update failed, view the log
The first is carried out according to the investigation report of Exception:
org.hibernate.exception.LockAcquisitionException: could not execute statement
Obviously, the database is deadlock, leading to not perform my update sql.
A thought: to find and kill the process deadlock
View the process
- check whether the lock table Show the OPEN TABLES the WHERE IN_USE > 0 ; - query the current user process SHOW PROCESSLIST; - query the current affairs of the SELECT * the FROM INFORMATION_SCHEMA.INNODB_TRX; - view the current transaction locking the SELECT * the FROM INFORMATION_SCHEMA.INNODB_LOCKS; - View current affairs such as locking the SELECT * the FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
Find out the current take up locked in the process id, kill off the can.
kill 1234;
Through the above process is not queried way deadlock, to exclude the influence of other processes, the database connection process I will have to kill off, then restart the service to reconnect, the problem still exists.
Thinking two: broken pipes
The reason database deadlock are:
- Insufficient system resources
- Order to promote the process of running inappropriate
- Misallocation of resources, etc.
Through the above investigation is the basic rule out a deadlock business code, followed by investigation of system resources, through the investigation found that indeed is the reason leading to system resources. Slow log space is too large, resulting in a database where the server can no longer write, so the newspaper IOException. When troubleshooting should start with the beginning of IO exception.
Then there is the slow log analysis to determine the cause or causes of a business code (execution time settings, etc.) slow log configuration, deleted to make room after completing the analysis.