【发布时间】:2018-08-02 07:01:21
【问题描述】:
我读到了 spring/hibernate 中的传播和隔离。 我有一种特定的方法,我们有
0. @Transactional (the default spring annotation)
1. read several rows
2. some business logic
3. read (from other table using some data from the first read)
这对我来说有点不安全。如果其他人在步骤 2 中删除了一行怎么办。 我认为我应该将方法注释更改为
@Transactional(readOnly = true, isolation = Isolation.SERIALIZABLE)
这对我的具体情况有效吗? (任务是修复导致系统出现一些问题的事务注释并尽可能少地更改其他代码行) 提前致谢。
【问题讨论】:
标签: java spring hibernate transactions