How to start a transaction in JPA using entityManager

前端 未结 4 569
陌清茗
陌清茗 2021-01-02 13:26

I have started working on an application which uses spring, hibernate, JPA, SOAP webservices. Now there is a requirement that certain queries have to be run in a transaction

4条回答
  •  佛祖请我去吃肉
    2021-01-02 13:38

    @Transactional annotation will do exactly what you need.

    http://docs.spring.io/spring/docs/current/spring-framework-reference/html/transaction.html#transaction-declarative-annotations

提交回复
热议问题