How to start a transaction in JPA using entityManager

前端 未结 4 538
陌清茗
陌清茗 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:39

    The add a hibernate.jta.allowTransactionAccess property with the value true and you should be allowed to use it manually. Though it's not a good practice to mix your strategies, having some code managed by JTA, some manually.

提交回复
热议问题