[英]The attribute readOnly is undefined for the annotation type Transactional
I am getting this error when I am putting this piece of code on a service method 当我将这段代码放在服务方法上时,我收到此错误
@Transactional(readOnly =true)
I am writing this code to make a transaction read only. 我正在编写此代码以使事务只读。 Can you please tell me What I did wrong in this case
你能告诉我在这种情况下我做错了什么
确保从org.springframework.transaction.annotation.Transactional
导入@Transactional
而不是从javax.transaction.Transactional
导入,因为readOnly
属性特定于Spring事务。
Add 加
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.