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

Hardy Ferentschik (JIRA) noreply at atlassian.com
Thu Nov 17 04:12:20 EST 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hardy Ferentschik resolved HSEARCH-977.
---------------------------------------

    Resolution: Fixed

> 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
>              Labels: hibernate, search
>
> 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...):
> {code}
> // 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...
> {code}
> 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):
> {code}
> // 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()
> ...
> {code}
> 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