javax.persistence.TransactionRequiredException: No transactional EntityManager available

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by Remigio
, 1 year ago
No EntityManager with actual transaction available for current thread - cannot reliably process 'persist' call
via Google Groups by Juan Quintanilla, 6 months ago
No EntityManager with actual transaction available for current thread - cannot reliably process 'remove' call
via GitHub by siim-romanov
, 1 year ago
No EntityManager with actual transaction available for current thread - cannot reliably process 'remove' call
via Google Groups by Siim, 6 months ago
No EntityManager with actual transaction available for current thread - cannot reliably process 'remove' call
javax.persistence.TransactionRequiredException: No transactional EntityManager available
at com.sun.proxy.$Proxy27.flush(Unknown Source)
at com.javamakeuse.test.ProductTest.testProductFinalAndGet(ProductTest.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)

Users with the same issue

4 times, 8 months ago
Once, 1 year ago
2 times, 2 years ago
Samebug visitor profile picture
Unknown user
Once, 1 week ago
Samebug visitor profile picture
Unknown user
2 times, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.