What is the read-only flag set to?
只读标志被设置成什么呢?
Transactional read-only flag pitfalls
@Transactional只读标志陷阱
Do nothing because the read-only flag is set to true?
什么也不做,因为只读标志被设置为true ?
The read-only flag is applied only if a transaction is started.
只读标志只在事务启动时应用。
In this case, no transaction was started, so the read-only flag is ignored.
在本例中,因为没有启动任何事务,所以只读标志被忽略。
The odd thing about the read-only flag is that you need to start a transaction in order to use it.
关于只读标志很奇怪的一点是:要使用它,必须启动一个事务。
The bottom line is that when you use an ORM-based framework, the read-only flag is quite useless and in most cases is ignored.
总的来说,在使用基于OR M的框架时,只读标志基本上毫无用处,在大多数情况下会被忽略。
A common pitfall I frequently come across in my travels is the improper use of the read-only flag on the Spring @Transactional annotation.
我在工作中经常碰到的一个常见陷阱是Spring @Transactional注释中的只读标志没有得到恰当使用。
Okay, so if that is the case, what does the @Transactional annotation do in Listing 6 when the read-only flag is set and the propagation mode is set to REQUIRED?
如果是这样的话,清单6 中的 @Transactional注释在设置了只读标志且传播模式被设置为REQUIRED时,它的作用是什么呢?
Faster index reopening (keeps unchanged segments opened) and better index reader concurrency (use of the read only flag).
重新生成索引的速度更快(让未改变的部分保持打开)并且读取索引时的并发性更好(使用了只读标志)。
Faster index reopening (keeps unchanged segments opened) and better index reader concurrency (use of the read only flag).
重新生成索引的速度更快(让未改变的部分保持打开)并且读取索引时的并发性更好(使用了只读标志)。
应用推荐