HowTo extend Spring Annotation @Transactional

前端 未结 2 815
一向
一向 2021-01-18 05:49

I have to use 3 different transaction managers in my webapp. So I wrote my own Annotation according to the Spring reference (Section 10.5.6.3 Custom shortcut annotations). <

2条回答
  •  长发绾君心
    2021-01-18 06:24

    You will have to create several custom annotations, I'm afraid, one for every use case, annotating each with the exact @Transactional annotation you need.

    Or you will have to write your own aspect in AspectJ ( extend org.springframework.transaction.aspectj.AbstractTransactionAspect from spring-aspects.jar ) to create your own transaction logic.

提交回复
热议问题