Home  >  Article  >  Database  >  MyBatis不能插入数据...我的错误

MyBatis不能插入数据...我的错误

WBOY
WBOYOriginal
2016-06-07 15:13:051755browse

自学时候发现myBatis不能执行insert 从mysql换到SqlServer也不行 于是想到可能是事务问题... 仔细检查代码发现: configuration typeAliases typeAlias type=cn.java.domain.Account alias=Account/ /typeAliases environments default=developmentenvironme

自学时候发现myBatis不能执行insert  从mysql换到SqlServer也不行 于是想到可能是事务问题...

 

仔细检查代码发现:

 

对了 就是这一块搞的

 

....

type=[JDBC OR MANAGED]

 

JDBC 应该是利用了jdbc的事务处理

MANAGED 这个配置什么也不做 不提交 也不回滚(问题就在这里了!),他会让spring等容器来管理事务。如果有的话 。。

 

mark,继续学习了。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn