My problem is that because the previous transaction has not ended yet, a new transaction cannot be started, so no matter what, an error must be reported. Add the @Transactional(propagation=Propagation.NOT_SUPPORTED) annotation on the service layer to start a new transaction, and it will be fine.
My problem is that because the previous transaction has not ended yet, a new transaction cannot be started, so no matter what, an error must be reported. Add the @Transactional(propagation=Propagation.NOT_SUPPORTED) annotation on the service layer to start a new transaction, and it will be fine.
You don’t
insert
操作吗?为什么要使用readOnly=true
。这表示只读事务。不能用于写操作。把
readOnly
just remove it and it will be ok.