AppFuse
  1. AppFuse
  2. APF-1281

occasional jdbc4 communications exception

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.2.1
    • Component/s: Service Layer
    • Labels:
      None

      Description

      We are seeing occasionally these errors. See stacktrace at the end.

      In order to avoid this, from what I've seen in stackoverflow, it is enough to add a couple lines to applicacionContext-esources.xml, remaining like this:

      <property name="defaultAutoCommit" value="true"/>
      <property name="validationQuery" value="SELECT 1+1"/>
      <property name="testOnBorrow" value="true"/>
      </bean>

      Maybe it should be there upfront, to avoid having to fix it

      com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 63,131,952 milliseconds ago. The last packet sent successfully to the server was 63,131,952 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      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:407)
      at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
      at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3348)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1967)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
      at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620)
      at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5022)
      at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:371)
      at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:371)
      at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:328)
      at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:87)
      ... 59 more
      Caused by: java.net.SocketException: Broken pipe
      at java.net.SocketOutputStream.socketWrite0(Native Method)
      at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
      at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
      at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
      at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
      at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3329)
      ... 67 more

        Activity

        Hide
        J. Garcia added a comment -

        Attached patch

        Show
        J. Garcia added a comment - Attached patch
        Hide
        Matt Raible added a comment -

        Fixed - thanks for the patch!

        Show
        Matt Raible added a comment - Fixed - thanks for the patch!

          People

          • Assignee:
            Matt Raible
            Reporter:
            J. Garcia
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development