Case1
@Transactional
public class UserServiceImpl implements UserService {
...................
public void method1(){
try{
method2();
}catch(Exception e){
}
}
public void method2(){
}
}
案例2
public class UserServiceImpl implements UserService {
...................
public void method1(){
try{
method2();
}catch(Exception e){
}
}
@Transactional
public void method2(){
}
}
如果发生任何异常,情况1会执行回滚操作,但是情况2不会执行。如果我遵循情况1,是否会有性能问题?