[hibernate-dev] Review of HSEARCH-361 (don't index entity change

Emmanuel Bernard emmanuel at hibernate.org
Mon Jan 3 05:59:11 EST 2011


Hey guys to warm up in 2011, I've reviewed HSEARCH-361.
I have two remarks

Can you add a unit test that checks mutable properties. I think it's covered but let's plan for a later bug :)

FullTextIndexEventListener compute the list of dirty properties by calling EntityPersister.findDirty(). I don't think that's entirely accurate. If you look when findDirty is called in Core, you'll see that we need to handle interceptors. Also in some cases we call findModified.

The good news is that core computes and caches the list of dirty properties (in FlushEntityEvent.getDirtyProperties()). Now the even we receive in Hibernate Search is PostUpdateEvent. I think we can enhance Core to pass along the list of dirty properties.
EntityUpdateAction.postUpdate / postCommitUpdate do create PostUpdateEvents and has the info (dirtyFields).

Basically we could keep the existing half working impl in HSearch until Hibernate Core 3.6.1 and use the new exposed property of PostUpdateEvent if available (reflection call). To minimize the reflection call, we should ahve a strategy (ie pre 3.6.1 and post 3.6.1) and at startup time instantiate the correct one.

WDYT?





More information about the hibernate-dev mailing list