会员登录 | 会员注册 | 意见建议 | 网站地图

站长资源综合门户

当前位置:首页 > 站长学院 > 数据库 > MySQL InnoDB之事务与锁详解

MySQL InnoDB之事务与锁详解

时间:2012-04-01 18:50:08   作者:   来源:   点击:
 4  SELECT VACCOUNT_ID from account  where ID =1001;uncommitted5SELECT VACCOUNT_ID from account  where ID =1001;uncommitted  6  ROLLBACK; 7SELECT VACCOUNT_ID from account  where ID =1001;caimao101510  8COMMIT;   tx_isolation:SET GLOBAL tx_isolation=’read-committed’ID事务1事务1输出事务2事务2输出1START TRANSACTION;   2SELECT VACCOUNT_ID from account  where ID =1001;caimao101510  3  START TRANSACTION; 4  UPDATE account set VACCOUNT_ID=’uncommitted’ where ID =1001; 5  SELECT VACCOUNT_ID from account  where ID =1001;uncommitted6SELECT VACCOUNT_ID from account  where ID =1001;caimao101510  7  COMMIT; 8SELECT VACCOUNT_ID from account  where ID =1001;uncommitted  9COMMIT;   tx_isolation:SET GLOBAL tx_isolation=’REPEATABLE-READ’ID事务1事务1输出事务2事务2输出1START TRANSACTION;   2SELECT VACCOUNT_ID from account  where ID =1001;caimao101510  3  START TRANSACTION; 4  UPDATE account set VACCOUNT_ID=’uncommitted’ where ID =1001; 5  SELECT VACCOUNT_ID from account  where ID =1001;uncommitted6SELECT VACCOUNT_ID from account  where ID =1001;caimao101510  7  COMMIT; 8SELECT VACCOUNT_ID from account  where ID =1001;caimao101510  9COMMIT;   tx_isolation:SET GLOBAL tx_isolation=’SERIALIZABLE’ID事务1事务1输出事务2事务2输出1START TRANSACTION;   2SELECT VACCOUNT_ID from account  where ID =1001;caimao101510  3  START TRANSACTION; 4  UPDATE account set VACCOUNT_ID=’uncommitted’ where ID =1001;STATE: Updating5SELECT VACCOUNT_ID from account  where ID =1001;caimao101510     事务2超时 6COMMIT;   7START TRANSACTION;   8UPDATE account set VACCOUNT_ID=’uncommitted’ where ID =1001;   9  START TRANSACTION; 10  SELECT VACCOUNT_ID from account  where ID =1001;STATE:statistics11  事务2超时 12commit;   tx_isolation
分享到:

网友评论

推荐数据库

热门数据库