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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:13:05
Original
1870 people have browsed it

自学时候发现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,继续学习了。

source:php.cn
Statement of this Website
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
Latest Issues
Mybatis mapping problem
From 1970-01-01 08:00:00
0
0
0
java - Mybatis related query
From 1970-01-01 08:00:00
0
0
0
REGEXP in mybatis
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template