I experience the same problem with a different domain model, having even newer versions of the Hibernate/Hibernate Search jars as above:
Hibernate-Core 3.3.1.GA
Hibernate Annotations 3.4.0 GA
Hibernate search 3.1GA
Lucene 2.4.0
I get the same Exception, with different stacktrace...:
Quote:
org.hibernate.AssertionFailure: collection [com.xyz.model.Category.Internal_Advertisement] was not processed by flush()
at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:228)
at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:356)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:124)
at org.hibernate.collection.PersistentSet.size(PersistentSet.java:162)
....
Where entity Category contains:
Code:
private java.util.Set<com.xyz.model.Internal_Advertisement> Internal_Advertisement
The Internal_Advertisment is not marked as @Indexed at this point.
So i can confirm this "bug"!
When i tried to annotate all the entities representing the type within the corresponding Set (Collection) as @Indexed this error message disappears but I get the next complaint from hibernate that:
Quote:
"A duplicate collection was found in Type ..."
(something like that don't remember exactly). Already reverted my changes to that point, sry.
I even hooked in (for debug purposes) and extended from
Code:
public class MyFullTextIndexEventListener extends
FullTextIndexEventListener {
private static final long serialVersionUID = 1L;
public void onPostRecreateCollection(PostCollectionRecreateEvent event) {
super.onPostRecreateCollection( event );
}
public void onPostRemoveCollection(PostCollectionRemoveEvent event) {
super.onPostRemoveCollection(event);
}
public void onPostUpdateCollection(PostCollectionUpdateEvent event) {
super.onPostUpdateCollection(event);
}
protected void processCollectionEvent(AbstractCollectionEvent event) {
super.processCollectionEvent(event);
}
and then registering this one as EventListener:
Code:
<!-- START HIBERNATE SEARCH / LUCENCE STUFF -->
<event type="post-update">
<listener class="com.xyz.search.MyFullTextIndexEventListener" />
</event>
<event type="post-insert">
<listener class="com.xyz.search.MyFullTextIndexEventListener" />
</event>
<event type="post-delete">
<listener class="com.xyz.search.MyFullTextIndexEventListener" />
</event>
<event type="post-collection-recreate">
<listener class="com.xyz.search.MyFullTextIndexEventListener" />
</event>
<event type="post-collection-remove">
<listener class="com.xyz.search.MyFullTextIndexEventListener" />
</event>
<event type="post-collection-update">
<listener class="com.xyz.search.MyFullTextIndexEventListener" />
</event>
But that did not help. I simply don't understand yet, why the empty sets are touched ?!!?
Any ideas on how to solve the problem? I agree, that my sets are empty and should not be index or "touched" at all...
Regards,
Martin