JUnit测试时,Mybatis报错:Manual close is not allowed over a Spring managed SqlSessio
来源:互联网 发布:企业宣传片 知乎 编辑:程序博客网 时间:2024/05/18 01:47
一、问题:JUnit测试时,mybatis报错:java.lang.UnsupportedOperationException: Manual close isnot allowed over a Spring managed SqlSession;
二、解决方案:在Mybatis的配置文件中在配置SqlSessionTemplate的标签中添加一个属性:scope="prototype",如下:
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate" scope="prototype"> <constructor-arg index="0" ref="sqlSessionFactory" /></bean>
阅读全文
0 0
- JUnit测试时,Mybatis报错:Manual close is not allowed over a Spring managed SqlSessio
- Spring-MyBatis实战之 Manual close is not allowed over a Spring managed SqlSession
- 异常处理Manual close is not allowed over a Spring managed SqlSession
- Manual commit is not allowed over a Spring managed
- Manual commit is not allowed over a Spring managed SqlSession
- Spring+Hibernate报错:Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL)
- iOS 【错误:'Changing the delegate of a tab bar managed by a tab bar controller is not allowed.'】
- junit测试报错:class not found
- spring mvc/mybatis整合,junit测试报BeanCreationException
- 报错localhost is not allowed to connect
- 保存数据报错Write operations are not allowed in read-only mode (FlushMode.MANUAL)
- spring+mybatis报错: 使用junit测试通过。。 使用maven打包出错。。
- Junit进行spring+jpa测试报错
- mysql客户端连接时,报错:is not allowed to connect to this MySQL server
- 报错:constructors not allowed a return type
- spring+mybatis+junit测试问题
- 整合SSH时,进行save操作报错Write operations are not allowed in read-only mode 只读模式下(FlushMode.NEVER/MANUAL)写操作
- js 报错 $ is not a function
- Python中的join()函数的用法
- 重定向
- 推荐 VS使用技巧分享
- PHP中include 与 require 的区别
- jQuery noConflict()
- JUnit测试时,Mybatis报错:Manual close is not allowed over a Spring managed SqlSessio
- java文件读写常用操作
- 秋招开始
- PTA 7-2 家谱处理
- 深入理解Spark ML:多项式朴素贝叶斯原理与源码分析
- 《DOS命令一日通》第五章 文件复制与磁盘复制
- 活锁、死锁和饥饿
- js数组循环的一种算法
- apktool