Why is Grails Searchable Plugin causing errors on Hibernate AutoFlush?

Posted by Mark Rogers on Stack Overflow See other posts from Stack Overflow or by Mark Rogers
Published on 2011-03-18T14:41:25Z Indexed on 2011/03/18 16:10 UTC
Read the original article Hit count: 239

In the Grails 1.2.5 project that I am trying to troubleshoot, we use the Grails Searchable plugin .5.5.1.

The problem is that whenever we attempt to index large sets domain classes, Grails keeps throwing:

ERROR hibernate.AssertionFailure - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) org.hibernate.AssertionFailure: collection [domain-class] was not processed by flush()

But the domain classes involved have been mapped and used by hibernate without issues outside of the calls to searchable plugin.

The use of the searchable plugin goes as follows:

  1. Create a compass session with compass.openSession()
  2. Begin compass transaction: compassSession.beginTransaction()
  3. Then compassSession.create(result.get(0)) is called on an important unindexed domain class
  4. Finally compassTransaction.commit() is called to commit the transaction.
  5. Goto 2 and process next domain class

Between the 3 and 4th Domain class, an autoflush is triggered that throws the error.

Can anyone give me any hints about how to solve this problem?

Has anyone encountered this problem before?

I know that they had a systemic issue with this back in pre .5 versions of the searchable-plugin. Is it possible those issues weren't totally fixed?

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about grails