org.hibernate.HibernateException: createSQLQuery is not valid without active transaction

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 Spring JIRA by Björn Voß, 1 year ago
createSQLQuery is not valid without active transaction
via Spring JIRA by Björn Voß, 1 year ago
createSQLQuery is not valid without active transaction
via Coderanch by David Irwin, 1 year ago
only beginTransaction() is valid when transaction not yet started
via Stack Overflow by user1497908
, 2 years ago
get is not valid without active transaction
via hibernate.org by Unknown author, 2 years ago
via Stack Overflow by VextoR
, 1 year ago
org.hibernate.HibernateException: createSQLQuery is not valid without active transaction
at ag.pinguin.myservice.impl.MyService.doSomething(MyService.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at undefined.$Proxy5.doSomething(Unknown Source)
at test.SpringTestMain.main(SpringTestMain.java:16)

Users with the same issue

You are the first who have seen this exception.

Write tip

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