Hi,
I am using a persistence event listener. It works fine with the Hibernate GORM backend. However, it does not work with the MonoDB GORM backend. Even a very simple test (with a fresh Grails 2.4.3 application) fails. My BootStrap.groovy contains this code:
def init = { servletContext ->
grailsApplication.mainContext.eventTriggeringInterceptor.datastores.each { k, datastore ->
servletContext.getAttribute(ApplicationAttributes.APPLICATION_CONTEXT) .addApplicationListener new MyPersistenceListener(datastore)
}
}
After replacing these two lines in BuildConfig.groovy
runtime ":hibernate4:4.3.5.5" // or ":hibernate:3.6.10.17"
runtime ":database-migration:1.4.0"
with
runtime ":mongodb:3.0.2"
the application won't even start anymore:
| Error 2014-09-22 13:50:39,480 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: Cannot get property 'datastores' on null object
Message: Cannot get property 'datastores' on null object
Line | Method
->> 7 | doCall in BootStrap$_closure1
Are persistence events not supported by the MongoDB GORM backed?
Regards,
Jesper