mstein / elasticsearch-grails-plugin

ElasticSearch grails plugin
Based on Graeme Rocher initial stub. Note that it is still in early stage.
Other
62 stars 164 forks source link

Fix for #15: Problem in Hibernate sessions management #44

Closed tcrossland closed 11 years ago

tcrossland commented 11 years ago

This should fix #15 for persistent entities updated in a Hibernate session. When Hibernate flushes the session, the AuditEventListener.onFlush() is invoked. The existing session can be used instead of creating a new one. Also, in this use case I don't see any reason why it's necessary to use a HibernatePersistenceContextInterceptor.

I've also modified the use of the interceptor for batch index requests, as it appears that they are not always being initialized/destroyed correctly.