Hibernate JPA and Spring javax.persistence.TransactionRequiredException: no transaction is in progress

后端 未结 13 2680
说谎
说谎 2020-12-05 17:52

When I call:

entityManager.flush()

I get the exception mentioned in the title.

I am using Hibernate JPA.

13条回答
  •  离开以前
    2020-12-05 18:32

    I did all the thing as a following. My problems was with "import" tag, there are several context root like servlet-context and root-context which are not dependent on each other. It becomes clear with Spring Explorer view in STS. No JTA for Tomcat.

    My advice would be universal: run Pet Clinic on your environment , How to run Spring 3.0 PetClinic in tomcat with Hibernate backed JPA or generate with Roo stub of application and try to compare your configs with referenced.

提交回复
热议问题