i'm trying to learn Grails console and had a problem. It looks like this:
When I start grails console in my project WITHOUT starting the project, I can persist data to my postgreSQL database.
However, when I started the project (aft开发者_如何学Cer a bunch of error messages from netbeans output), I cannot do what I did anymore from Grails console.
It says this:
Exception thrown: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
....
That means, I lost Hibername Session while starting my project via netbean......
Could some one give me hand?
Thanks so much in advance!
john
Use DomainClass.withTransaction{
}
精彩评论