欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

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

程序员文章站 2022-05-23 22:33:37
...
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.