MySQLNonTransientConnectionException: No operations allowed after connection closed

Problem

The Datameer GUI in inaccessible. When reviewing the conductor.log file on the Datameer server, the following stack trace is visible:

[system] ERROR [2014-01-01 00:00:00.000] [JobScheduler thread-1] (JDBCTransaction.java:198) - JDBC rollback failed
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
	at sun.reflect.GeneratedConstructorAccessor123.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
	at com.mysql.jdbc.Util.getInstance(Util.java:383)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1023)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:997)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:983)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:928)
	at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1323)
	at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1315)
	at com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:5057)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.jamonapi.proxy.MonProxy.invoke(MonProxy.java:127)
	at com.jamonapi.proxy.JDBCMonProxy.invoke(JDBCMonProxy.java:100)
	at com.sun.proxy.$Proxy58.rollback(Unknown Source)
	at com.mchange.v2.c3p0.impl.NewProxyConnection.rollback(NewProxyConnection.java:855)
	at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:213)
	at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:192)
	at org.hibernate.ejb.TransactionImpl.rollback(TransactionImpl.java:107)
	at datameer.dap.conductor.persistence.PersistenceService.rollbackTransaction(PersistenceService.java:139)
	at datameer.dap.conductor.persistence.TransactionHandler.execute(TransactionHandler.java:119)
	at datameer.dap.conductor.persistence.TransactionHandler.executeInNewTransaction(TransactionHandler.java:92)
	at datameer.dap.conductor.job.SingleThreadedTransactionController.execute(SingleThreadedTransactionController.java:32)
	at datameer.dap.conductor.job.SingleThreadedController.executeAndLogMetrics(SingleThreadedController.java:141)
	at datameer.dap.conductor.job.SingleThreadedController.loop(SingleThreadedController.java:117)
	at datameer.dap.conductor.job.SingleThreadedController$2$1.run(SingleThreadedController.java:89)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
	at datameer.dap.conductor.webapp.security.DatameerSecurityService.runAsUser(DatameerSecurityService.java:124)
	at datameer.dap.conductor.webapp.security.DatameerSecurityService.runAsUser(DatameerSecurityService.java:139)
	at datameer.dap.conductor.job.SingleThreadedController$2.run(SingleThreadedController.java:85)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:662)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 60,621 milliseconds ago.  The last packet sent successfully to the server was 1 milliseconds ago.
	at sun.reflect.GeneratedConstructorAccessor124.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1137)
	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3715)
	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3604)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4149)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2834)
	at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5368)
	at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.jamonapi.proxy.MonProxy.invoke(MonProxy.java:127)
	at com.jamonapi.proxy.JDBCMonProxy.invoke(JDBCMonProxy.java:100)
	at com.sun.proxy.$Proxy58.setAutoCommit(Unknown Source)
	at com.mchange.v2.c3p0.impl.NewProxyConnection.setAutoCommit(NewProxyConnection.java:881)
	at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:87)
	at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473)
	at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:60)
	at datameer.dap.conductor.persistence.PersistenceService.beginTransaction(PersistenceService.java:81)
	at datameer.dap.conductor.persistence.TransactionHandler.execute(TransactionHandler.java:107)
	... 12 more
Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
	at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:3161)
	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3615)
	... 30 more

Cause

This is a MySQL settings issue. The response time of the MySQL server (60,621 ms in the example above) exceeds the MySQL server's configured wait_timeout value.

Solution

To resolve this issue, work with the MySQL database administrator to increase the value of the wait_timeout parameter. 

This setting is configurable in the my.cnf file. By default, mysql sets this value to "28800" seconds. If this value has been modified from the default, consider reverting it back to the default to restore connectivity to the Datameer server.