??mysql???????????
???????????? ???????[ 2016/3/3 11:28:26 ] ????????????? MySQL
??????t???
????????????????????????mysql???????????????????MySQL??????autocommit???????????????????????2?????MySQL????????????????
????mysql> set autocommit = 0;
????Query OK?? 0 rows affected (0.01 sec)
????mysql> select @@autocommit;
+--------------+
| @@autocommit |
+--------------+
| 0 |
+--------------+
1 row in set (0.00 sec)
Connect a:
mysql> begin;
Query OK?? 0 rows affected (0.00 sec)
mysql> select age from users where id =1 for update;
+-----+
| age |
+-----+
| 24 |
+-----+
1 row in set (0.00 sec)
mysql> update users set age = 25 where id =1;
Query OK?? 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> commit;
Query OK?? 0 rows affected (0.01 sec)
Connect b: ??a?????δ???????
mysql> select * from users where id =1 for update;
ERROR 1205 : Lock wait timeout exceeded; try restarting transaction
mysql> update users set age = 22 where id =1;
ERROR 1205 : Lock wait timeout exceeded; try restarting transaction
????connectb?????connecta?????????У???????????
???????????У????SELECT...FORUPDATE??LOCKINSHAREMODE????????????????????У????SELECT...????????
????MySQLselect…forupdate??RowLock??TableLock
???????????????????select…forupdate????????????????????????????Щ???????MySQLInnoDB???Row-LevelLock????????С???????????????/??????MySQL??????Rowlock(??????????????)??????MySQL???????TableLock(?????????????????)
?????????????????????????????????洢???????????м???????????????MySQLServer????й?????????????ù?????У?MySQL?????Щ???????MySQLServer?????????????????????????unlock_row??????????????????????????(Υ?????????Э??????)???????????????????????????????????????????????????????????????????????????????MySQL?????Ч??????Υ???淶??
????????????????????MySQL??????????RR??????????????????????????????????????????????????????MySQLServer???????????????????????????????????Щ?е????????????????????????????
?????????
??????????????????????“??????????”??????????????????????????????????Ч????棬?????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????л?????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????С????????????????????????????????????????????????????????????????????????????????????????????????????????????y??????????y??????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???mysql?????????????mysql????? distinct?÷?MySQL?н???????????з??Mysql?????????MySQL Cluster??δ????????????????ν?MySQL??????????300???????MySQL???Uber???????????????????MySql SQL??????????MySQL?????????????????λЧ?????SQL???Java???????:?????MySQL???????linux?°??mysql????MySQL ???????????????????binlog??MySQL????????????Щ??????MySQL???????Mysql???????JDBC?????mysql?????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????