Some work is done outside global transaction
时间:2006-12-04
来源:gladness
Query OK, 0 rows affected (0.08 sec)
mysql> set autocommit=0;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into test values('abc');
Query OK, 1 row affected (0.00 sec)
mysql> xa start '1111';
ERROR 1400 (XAE09): XAER_OUTSIDE: Some work is done outside global transaction
如果set autocommit=0后面紧接着就xa start,是不会报错的。因为此时本地(非XA)事务还未开始。
手册上说:
Within the context of a given client connection, XA transactions and local (non-XA) transactions are mutually exclusive. For example, if XA START has been issued to begin an XA transaction, a local transaction cannot be started until the XA transaction has been committed or rolled back. Conversely, if a local transaction has been started with START TRANSACTION, no XA statements can be used until the transaction has been committed or rolled back.
在一个客户端连接的上下文中,XA事务和本地(非XA)事务是互斥的。例如,如果用XA START开始了一个XA事务,在该事务提交或者回滚前,是不能开始本地事务的(在同一连接中)。相反,如果用START TRANSACTION开始了一个本地事务,在该事务提交或者回滚前,XA相关的语句是不能执行的。
Note that if an XA transaction is in the ACTIVE state, you cannot issue any statements that cause an implicit commit. That would violate the XA contract because you could not roll back the XA transaction. You will receive the following error if you try to execute such a statement:
注意如果一个XA事务处于ACTIVE状态,你不能执行导致隐含提交的语句。那会破坏XA的规矩,因为你会无法回滚XA事务。如果你尝试执行这样一条语句,你会得到下面的错误:
ERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be executedmysql> start transaction;
when global transaction is in the ACTIVE state
Query OK, 0 rows affected (0.00 sec)
mysql> xa start '2222';
ERROR 1400 (XAE09): XAER_OUTSIDE: Some work is done outside global transaction
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28