[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-679) Entity whose related entity collection is updated causes loading of @ContainedIn entities

Sanne Grinovero (JIRA) noreply at atlassian.com
Mon Mar 28 10:33:08 EDT 2011


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

Sanne Grinovero commented on HSEARCH-679:
-----------------------------------------

Hi Tom,
did you come up with a possible test? I think we need to release 3.4 soon, tagging a CR today. No worries we can make a 3.4.1 if this doesn't make it, so you won't need to wait for 3.5.
To answer your mailing-list question on testing:
Creating test data you'll have initialized entities, but after the test fixture has been setup you should close the Session, and use a new Session in the test method. this will load data and collections which are not initialized (make sure they are not eagerly loaded).
This is how we usually make tests and what I would try in this case, but if this doesn't work out or you feel more comfortable with mocks I think that would be fine as well. Just we'll need to discuss on mailing list about which mock library to depend on (I like easymock, but can't make this decision alone).

> Entity whose related entity collection is updated causes loading of @ContainedIn entities
> -----------------------------------------------------------------------------------------
>
>                 Key: HSEARCH-679
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-679
>             Project: Hibernate Search
>          Issue Type: Bug
>          Components: engine
>    Affects Versions: 3.2.1, 3.3.0.Final
>         Environment: Hibernate 3.6.1-SNAPSHOT/Hibernate Search 3.4.0-SNAPSHOT and Hibernate 3.5.6/Hibernate Search 3.2.1
>            Reporter: Tom Waterhouse
>            Assignee: Sanne Grinovero
>             Fix For: 3.4.0
>
>         Attachments: HSEARCH-679.zip
>
>
> This problem seems related to HSEARCH-361.  An entity that references another entity as @ContainedIn is causing the load of entities related to the other entity.  
> Using the model below, the update of the collection of D instances in the class C causes the load of related classes B and A.
> public class A {
>    @Field
>    private String name;
>    @IndexEmbedded
>    private B
> }
> public class B {
>    @ContainedIn
>    private A a;
>    @IndexEmbedded
>    private C c;
> }
> public class C {
>    @ContainedIn
>    private Collection<B> b;
>    // NOT INDEXED
>    private Collection<D> d;
> }
> public class D {
>    public String value;
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list