HibernateException in Grails 3 whenever doing GORM in console or shell

95 ogledov
Preskoči na prvo neprebrano sporočilo

Paul Waldo

neprebran,
5. dec. 2015, 15:03:285. 12. 15
do Grails Dev Discuss

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

Milton Hagler

neprebran,
16. sep. 2016, 08:17:0916. 9. 16
do Grails Dev Discuss
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. 


Odgovori vsem
Odgovori avtorju
Posreduj
0 novih sporočil