SpringSource/grails-data-mapping — Issue #18: [Grails] mongodb and hibernate are not playing well together
Author: rosenfeld
Created: 2011-12-21 17:52:21+00:00
State: open

Extracted from a message I've sent to the Grails-users mailing list:

--

After I replaced my Java class for dealing with MongoDB with the mongodb plugin I am now experiencing some problems on Grails 2 in development mode.

I have two after filters that will be saving data in the database. One of the filters is saving a log entry in the MongoDB database while the other is saving an entry in the hibernate database.

After I changed a controller in development mode I get this message:

"No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here"

It doesn't happen always, but if I restart the server it will work again.

But if I change some domain class, I'll get this:

"Join queries are not supported by MongoDB"

But the stacktrace will show that it is trying to connect to the database configured by Hibernate using the mongodb session...

The message is not always the same when I change some domain class. Sometimes I get this:

"No Datastore Session bound to thread, and configuration does not allow creation of non-transactional one here"