当前位置:Gxlcms > mysql > mybatis-关于mysql的问题很着急,我没配事务报事务连接的错

mybatis-关于mysql的问题很着急,我没配事务报事务连接的错

时间:2021-07-01 10:21:17 帮助过:24人阅读

mybatismysqlexcel

就一个查询所有订单 然后excel导出的功能, 没有涉及到事务 我也没有配事务, 为什么部署到远端后 每天前几次连接都会出现这种问题. 这是为什么啊? 多请求几次这个借口 就会变得正常, 希望大神能够帮我分析一下.

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:Communications link failure during rollback(). Transaction resolution unknown.
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
com.mysql.jdbc.Util.getInstance(Util.java:386)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:5068)
org.apache.ibatis.datasource.pooled.PooledDataSource.popConnection(PooledDataSource.java:391)
org.apache.ibatis.datasource.pooled.PooledDataSource.getConnection(PooledDataSource.java:82)
org.apache.ibatis.transaction.jdbc.JdbcTransaction.openConnection(JdbcTransaction.java:131)
org.apache.ibatis.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:58)
org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:271)
org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:69)
org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:56)
org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:259)
org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:132)
org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105)
org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81)
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98)
org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:114)
org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58)
org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43)
$Proxy6.findByDate(Unknown Source)
com.axinpay.orderToExcel.service.impl.OrderInfoServiceImpl.findByDate(OrderInfoServiceImpl.java:20)
com.axinpay.orderToExcel.servlet.OrderInfoServlet.service(OrderInfoServlet.java:61)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.63 logs.

人气教程排行