悲观锁就在select 后面加上for update,最后一定要commit/rollback才能释放锁吗(select后没update的话)
    正常流程:
       select id,name,age from a where id =4 for update;//锁住,别人不能对该行记录操作
       update from a set name ='aaa' where id =4;
       commit;//释放锁(如果没有commit,多久别人才能访问)
  
   另类流程:
      select id,name,age from a where id =4 for update;//锁住,别人不能对该行记录操作
      ....//没有再对该记录进行操作,如果想解锁是不是也要commit