spring 事务注解
默认遇到throw newRuntimeException("...");会回滚
需要捕获的throw newException("...");不会回滚
// 指定回滚
@Transactional(rollbackFor=Exception.class)
//指定不回滚
@Transactional(noRollbackFor=Exception.class)
@Transactional(propagation=Propagation.NESTED)
//readOnly=true只读,不能更新,删除
@Transactional (propagation =Propagation.REQUIRED,readOnly=true)
// 设置超时时间
@Transactional (propagation =Propagation.REQUIRED,timeout=30)
// 设置数据库隔离级别
@Transactional (propagation =Propagation.REQUIRED,isolation=Isolation.DEFAULT)