我使用两个窗口,因为我想实现事务的概念。MySQL即使提交后也没有显示更新的数据
窗口1:begin;
窗口1:update employee set salary = 45000 where ssn = '123456789';
窗口2:begin;
窗口2:select * from employee where ssn = '123456789';
这里,该命令将显示我以前的数据是正确的。
窗口1:commit;
窗口2:select * from employee where ssn = '123456789';
在这里,我应该得到的45000更新的薪水,但我的车窗2只显示以前的数据。我在哪里做错了?
谢谢你的回答。但我只是想知道如何改变我的SQL中的DEFAULT TRANSACTION ISOLATION LEVEL来读取提交的GLOBALLY。 –
关于set transaction语法,请参阅mysql手册。 – Shadow