3

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 (after 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

1 Answer 1

3

Use DomainClass.withTransaction{

}

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.