mybatis 报ExecutorException: Executor was closed.
在同一个方法里面,有两步update数据库操作,分别是库中的两张表,但这两步是一个完整事务,第一步update成功了,第二步就报了这个错误
请高手帮忙看下,可能是什么原因?
报错如下:
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. C
ause: org.apache.ibatis.executor.ExecutorException: Executor was closed.
### The error may exist in file [/export/App/transfer.support.ws.aa.com/WEB-INF/classes/mapper/order/Order.xml]
### The error may involve com.aa.bb.ts.support.server.dao.mapper.OrderMapper.updateOrderById
### The error occurred while executing an update
### Cause: org.apache.ibatis.executor.ExecutorException: Executor was closed.
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147)
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.aa.bb.common.db.mybaties.SqlSessionInterceptor.doInvoke(SqlSessionInterceptor.java:204)
at com.aa.bb.common.db.mybaties.SqlSessionInterceptor.invoke(SqlSessionInterceptor.java:173)
at $Proxy39.update(Unknown Source)
at com.aa.bb.common.db.mybaties.SqlSessionTemplate.update(SqlSessionTemplate.java:147)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40)
at $Proxy42.updateOrderById(Unknown Source)
at com.aa.bb.ts.support.server.core.service.impl.OrderAndDetailServiceImpl.updateOrderById(OrderAndDetailServiceImpl.java:134)
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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
at $Proxy45.updateOrderById(Unknown Source)
at com.aa.bb.ts.support.server.core.service.impl.AntiAndOrderServiceImpl.cancelAntiAndOrderById(AntiAndOrderServiceImpl.java:131)
... 39 more
Caused by: org.apache.ibatis.executor.ExecutorException: Executor was closed.
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:106)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:145)
... 59 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
提示的是
Executor已经被关闭,能发下调用方式吗?由于mybatis都是从mapper加载sql交由内部executor执行,默认的SimpleExecutor,批处理需要使用如下配置