当前位置:网站首页>TransactionTemplate transaction programmatic way
TransactionTemplate transaction programmatic way
2022-07-31 06:01:00 【Floating life like a dream】
It is recommended to use declarative transaction @Transactional(rollbackFor = Exception.class) granularity is not enough, split method
import org.springframework.transaction.support.TransactionTemplate;@Autowiredprivate TransactionTemplate trans;/*** Programmatic transactions*/public void transfer() {// no return valuetrans.executeWithoutResult((status) ->{boolean save = this.save(t);if(!save) {status.setRollbackOnly();}});// have return valuetrans.execute((status) ->{boolean save = this.save(t);if(!save) {status.setRollbackOnly();}return new Object();});}边栏推荐
猜你喜欢

MySQL压缩包方式安装,傻瓜式教学

Xiaomi mobile phone SMS location service activation failed
![[Cloud native] Ribbon is no longer used at the bottom layer of OpenFeign starting from the 2020.0.X version](/img/7e/1d27e3f1856ab8c6cbfc5221c717bb.png)
[Cloud native] Ribbon is no longer used at the bottom layer of OpenFeign starting from the 2020.0.X version

flutter arr 依赖

unicloud 发布后小程序提示连接本地调试服务失败,请检查客户端是否和主机在同一局域网下

this points to the problem

Why does read in bash need to cooperate with while to read the contents of /dev/stdin

VS2017连接MYSQL

Tencent Cloud GPU Desktop Server Driver Installation

一文速学-玩转MySQL获取时间、格式转换各类操作方法详解
随机推荐
Using IIS10 to build an asp website in win11
小米手机短信定位服务激活失败
VTK环境配置
浅谈对分布式模式下CAP的理解
腾讯云轻量服务器删除所有防火墙规则
sql 添加 default 约束
Pure shell implementation of text replacement
VS2017 connects to MYSQL
浏览器查找js绑定或者监听的事件
quick lua加密
understand js operators
Android软件安全与逆向分析阅读笔记
this指向问题
数据库 | SQL查询进阶语法
The latest MySql installation teaching, very detailed
A simple bash to powershell case
MySQL错误-this is incompatible with sql_mode=only_full_group_by完美解决方案
Flow control statement in js
quick-3.5 lua调用c++
Understanding of objects and functions in js