大佬们 ,请教2问题,可以帮解答么


update 条件有主键会加行锁
1.同一个事物中 多次对同一条数据update为啥不会有“锁的问题”
2.
方法A Transaction(REQUIRED)
执行update where id =1;
执行方法B;
方法B Transaction(REQUIRED_NEW)
执行 update where id =1;
方法A 和B 不是同一个事物 ,修改同一条数据 为啥也不会出现锁的问题



update 条件有主键会加行锁
1.同一个事物中 多次对同一条数据update为啥不会有“锁的问题”
2.
方法A Transaction(REQUIRED)
执行update where id =1;
执行方法B;
方法B Transaction(REQUIRED_NEW)
执行 update where id =1;
方法A 和B 不是同一个事物 ,修改同一条数据 为啥也不会出现锁的问题