HibernateException in Grails 3 whenever doing GORM in console or shell

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

HibernateException in Grails 3 whenever doing GORM in console or shell

PaulWaldo

In grails 2.x I could perform GORM operation in both the console and shell.  Now when I try to do the same thing in 3.0.9, I get this error:


groovy:000> Person.count()

ERROR org.springframework.dao.DataAccessResourceFailureException:

Could not obtain current Hibernate Session; nested exception is org.hibernate.HibernateException: No Session found for current thread


I can wrap my statements in a transaction, but that defeats the ease of the shell and the console.  Any ideas how to resolve this?  Thanks!

Paul

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/4bdcdbe4-8e44-4367-bcd1-893fb0dc18da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HibernateException in Grails 3 whenever doing GORM in console or shell

Milton Hagler
Same issue with 3.0.19. 

Runs perfectly inside Intellij IDE, using run-app and as a JAR file from the command line, but not as a WAR file in Tomcat 7. 


--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/95489de3-c9cf-485f-9e3e-42b95e3f1157%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...