Graeme was so kind to help me with this problem. My app worked well with Grails 1.0.4 but not in 1.1-beta3 any more.
My first wild guess leading to a
HibernateException: contains is not valid without active transactionexception was my use of annotated Hibernate classes together with additional constraints in Grails, but Graeme figured out that it was the current session context i configured in hibernate.cfg.xml like so:
<property name="hibernate.current_session_context_class">thread</property>
I used this fragment for various JUnit test and in one case in a J2SE application where the same hibernate classes are needed. Together with a JTA Manager, this fragment is not needed and in case of Grails it has to go.
To run my tests i added the following statement right before opening my session:
final Properties nonJtaEnv = new Properties(); nonJtaEnv.put("hibernate.current_session_context_class", "thread"); sessionFactory = new AnnotationConfiguration().configure("hibernate.cfg.xml").addProperties(nonJtaEnv).buildSessionFactory();