--Query MySQL database link idle time hold maximum idle time in seconds
SHOW VARIABLES WHERE variable_name = ' interactive_timeout ';
--The wait_timeout is similar to the parameter, and when modified, it is modified together.
SHOW VARIABLES WHERE variable_name = '%timeout ';
--Problem solving
Com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:Communications link Failure
Caused By:org.hibernate.TransactionException:JDBC commit failed
At Org.hibernate.transaction.JDBCTransaction.commit (jdbctransaction.java:130)
At Org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit (hibernatetransactionmanager.java:657 )
... More
caused by:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:Communications link failure during Commit (). Transaction resolution unknown.
Com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:No operations allowed after connection closed.
--Pay attention.
(1) Encounter such a problem, first determine whether the idle time after the opening of the transaction is too long resulting in the transaction link is recycled, as long as you operate on the database, it is not idle, this problem does not occur
(2) network problems, resulting in the database cannot be linked
(3)
--The number of file lines in a Linux system query file
GREP-A 10-b 5 "Query data string" Catalina.out.2015-10-14.log |more
Grep-rn "Query string" file name
--P Indicates the line, cannot save
Sed-n ' start line, end line P ' Catalina.out.2015-10-14.log
Com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:Communications Link Failure Database error