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

Sanne Grinovero (JIRA) noreply at atlassian.com
Wed Nov 16 16:32:20 EST 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44341#comment-44341 ] 

Sanne Grinovero commented on HSEARCH-977:
-----------------------------------------

Hi Igor,
thank you for reporting this. I've created a test for it and verified that this was actually resolved already by the changes for HSEARCH-901.
You could use either the latest commit on the 3.4 branch or any of the latest 4.x releases, or it will be included in 3.4.2 when we release it.

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