Spring - No EntityManager with actual transaction available for current thread - cannot reliably process 'persist' call

前端 未结 15 1585
自闭症患者
自闭症患者 2020-11-30 20:08

I get this error when trying to invoke \"persist\" method to save entity model to database in my Spring MVC web application. Can\'t really find any post or page in internet

15条回答
  •  萌比男神i
    2020-11-30 20:25

    I got this exception while attempting to use a deleteBy custom method in the spring data repository. The operation was attempted from a JUnit test class.

    The exception does not occur upon using the @Transactional annotation at the JUnit class level.

提交回复
热议问题