Keeping the session Open in JUnit/JPA/Hibernate/Struts and Spring integration test - No Session or session closed - LazyInitialization Exception

前端 未结 1 1689
故里飘歌
故里飘歌 2020-12-21 04:37

My application uses Struts2(mvc), Spring (Dependency Injection), JPA with Hibernate, JUnit along with struts2-junit plugin and struts2 spring plugin.

Here is my test

相关标签:
1条回答
  • 2020-12-21 05:00

    If it helps anyone, I couldn't get the @Transaction to work. But I put this:

     @PersistenceContext(type=PersistenceContextType.EXTENDED)
    

    and it works now!

    .....

    0 讨论(0)
提交回复
热议问题