[hibernate-issues] [Hibernate-JIRA] Created: (HSEARCH-977) MassIndexer freezes when there is an indexed 'id' filed, which is not document's id

Igor (JIRA) noreply at atlassian.com
Tue Nov 15 12:45:22 EST 2011


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

                 Key: HSEARCH-977
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-977
             Project: Hibernate Search
          Issue Type: Bug
          Components: massindexer
    Affects Versions: 3.4.0.Final
         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
            Reporter: Igor


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...):

// 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):

// 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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list