[hibernate-dev] A fine grained way to mark @Transient and @ClassBridges as dirty

Marc Schipperheyn m.schipperheyn at gmail.com
Fri Jun 22 12:28:02 EDT 2012


@Transient @Field and @ClassBridges mark methods and classes dirty by
default because there is currently no way for HSearch to know which fields
are managed here. In the case of @Transient @Field this will often be ok,
because it will only lead to some superfluous extra indexing which is not a
big hit on performance. However, a ClassBridge will mark all objects of a
certain class as dirty and especially with Lazy connections, this can lead
to a flurry of unnecessary database calls and indexing actions. Also with
@Transient @Field this can occur when underlying Lazy connections are
initialized.

HSEARCH-1093 talks about a way to improve this by indicating to HSearch
which fields are actually managed by the Field (or ClassBridge) so as to
prevent unnecessary invocations. I'm curious about ideas on this. Could
this be an attribute, such as includePaths that overrides a default
@Field(managedFields={"user.id"})
@ClassBridge(managedFields={"user.id","description"})

or could it be an annotation
@DirtyAware(value={"user.id","description"})


More information about the hibernate-dev mailing list