Com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:Communications link failure during rollback () .
See this error first look at the code, first think, I first opened the database connection, and executed the query and insert operation is no problem ah, but the final rollback on the issue, the following according to the log analysis:
Solution:
1. Modify HTTP request time, connection request Timeout + read Timeout <60ms
2. Do not place the HTTP request in the transaction operation of the database:
1) Perform the database operation before the HTTP request, then execute the HTTP request, the state of the operation before the update (success, failure, unknown)
2) database records allow certain data loss, execute HTTP requests first, and then write execution results to the database
MySQL Communications link failure (with HTTP request)