MySQL社区

标题: MySQLNonTransientConnectionException: Communications link failure during comm [打印本页]

作者: 量晶晶    时间: 2017-8-25 15:32
标题: MySQLNonTransientConnectionException: Communications link failure during comm
HI, 我们用mysql 5.6.21 和  mysql-connector-java-5.1.17.jar 做ETL,mysql  5.6.21 作为目标库, mysql-connector-java-5.1.17.jar作为JDBC驱动,
从源表获取30万数据到目标表存到mysql,把30万数据分拆成3000个循环,每个commit 100条记录,有时会平凡报下面的错。

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure during commit(). Transaction resolution unknown.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_92]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_92]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_92]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_92]
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) ~[na:na]
        at com.mysql.jdbc.Util.getInstance(Util.java:386) ~[na:na]
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013) ~[na:na]
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) ~[na:na]
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982) ~[na:na]
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) ~[na:na]
        at com.mysql.jdbc.ConnectionImpl.commit(ConnectionImpl.java:1665) ~[na:na]
        at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:334) ~[na:na]
        at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:211) ~[na:na]

谁有这方面的经验,请指教一二,不胜感激






欢迎光临 MySQL社区 (http://www.mysqlpub.com/) Powered by Discuz! X3.2