1.事务:transaction -- 事务开启的唯一条件就是:对数据库进行增,删,改的时候 -- 换句话说,对数据进行增删改以后,必须要执行提交或者回滚 -- 事务就是把数据库中的数据从一致状态转换为另一种一致状态 delete from teacher where id = 7;-- 现在把teacher给锁住了 -- 自动执行提交 commit; -- 自动回滚 rollback; update teacher set name='hehehehehehehe',age=30 where…