We're updating the issue view to help you get more done. 

MassIndexer freezes when there is an indexed 'id' filed, which is not document's id

Description

MassIndexer hangs (and the reason was quite difficult to figure out from logs...) when I have the following
(I simplified the actual class/interface hierarchy in this example; this should not matter I believe...):

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 // PK sits in a super class @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(length=40) @org.hibernate.annotations.Entity(dynamicUpdate = true, dynamicInsert = true) public abstract class MyElementImpl implements MyElement { // ... @Id @DocumentId public String getRDFId() { return uri; } //etc... } // in an entity sub-class I have a property/column 'id' - @Entity @org.hibernate.annotations.Entity(dynamicUpdate = true, dynamicInsert = true) public class XrefImpl extends MyElementImpl implements Xref { //... @Field(name="id", index=Index.TOKENIZED) @Column(name="id") public String getId() { return refId; } public void setId(String id) { this.refId = id; } // etc...

This seems to be Hibernate Search framework issue. This may be also an issue for other Hibernate Search versions, but I do not remember which I have tried (I haven't tried the latest yet).

  • though I found a workaround/fix that works for me (using another setter/getter and index field name):

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 // in the sub-class - @Field(name="xrefId", index=Index.TOKENIZED) @Column(name="id") public String getIdx() { return refId; } public void setIdx(String id) { this.refId = id; } // make the actual interface method implementation transient @Transient public String getId() ...

Thank you.

Environment

Mac, Linux, MySQL 5.1.x; Java 1.6, Hibernate 3.6.3.Final, hibernate-jpa-2.0-api 1.0.0.Final (entity annotations), Spring 3.0.5.RELEASE

Status

Assignee

Unassigned

Reporter

IR

Labels

Suitable for new contributors

Yes, likely

Pull Request

None

Feedback Requested

None

Components

Fix versions

Affects versions

3.4.0.Final

Priority

Major