This repository has been archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.
如果mysql的配置是autocommit,对于innodb 引擎的表,是否还会支持事务? #1121
Labels
环境:
mysql是5.7
mysql配置是autocommit=1
表结构是:
Create Table: CREATE TABLE
t
(id
int(11) DEFAULT NULL,name
varchar(255) DEFAULT NULL,other
text,other2
text) ENGINE=InnoDB DEFAULT CHARSET=utf8
代码:
type t struct {
ID int
Name string
Other interface{}
xorm:"JSON"
Other2 interface{}
xorm:"JSON"
}
我在update 之后和 session.Commit() 之前设置了断点,当程序执行到断点的时候,到数据库上查询,发现数据已经更改完成;
对于mysql配置为autocommit,这种情况下是不支持事务吧。
在eng.NewSession() 的时候,是否应该mysql session级别 的autocommit 关闭?
The text was updated successfully, but these errors were encountered: