[英]Does a Spring @Transactional annotated method overwrite an @Transactional(readOnly=true) method if called within it?
In the name of reuse, I would like to call a method annotated with @Transactional(readOnly)
from inside a method annotated with @Transactional
with exclusive locking. 在复用的名字,我想调用带注释的方法
@Transactional(readOnly)
从标注有一个方法内@Transactional
独家锁定。
Simply put, Will this overwrite the shared locking optimizations used for the readonly call? 简而言之,这会覆盖用于只读调用的共享锁定优化吗?
Depends on value of propagation
you set for your outer transaction. 取决于您为外部交易设置的
propagation
价值。 All that explained really well in Spring documentation: 所有这些在Spring文档中都很好地解释了:
http://docs.spring.io/spring-framework/docs/4.0.x/spring-framework-reference/html/transaction.html http://docs.spring.io/spring-framework/docs/4.0.x/spring-framework-reference/html/transaction.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.