[richfaces-issues] [JBoss JIRA] (RF-12608) pickList without collectionType results in failure to lazily load

Juraj Húska (JIRA) jira-events at lists.jboss.org
Tue Dec 11 07:51:17 EST 2012


    [ https://issues.jboss.org/browse/RF-12608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740567#comment-12740567 ] 

Juraj Húska edited comment on RF-12608 at 12/11/12 7:49 AM:
------------------------------------------------------------

I switched persistence context to extended and the {{LazyInitializationException}} disappeared.

Therefore I can not reproduce the issue.

In this [line|https://github.com/jhuska/RF-12608/blob/master/src/main/java/org/richfaces/tests/Bean.java#L21] I am printing the class of the returned collection. The output from that line is {{class org.hibernate.collection.internal.PersistentBag}}, which is some kind of runtime proxy according to [this|http://java.dzone.com/articles/jpa-lazy-loading] article, which retrieves all entities once firstly accessed. The same apply when I am not finding the runtime class of the list.

Ken H., could you please confirm that the behavior align with your description ? Thanks.


                
      was (Author: jhuska):
    I switched persistence context to extended and the {{LazyInitializationException}} disappeared.

Therefore I can not reproduce the issue.

In this [line|https://github.com/jhuska/RF-12608/blob/master/src/main/java/org/richfaces/tests/Bean.java#L21] I am printing the class of the returned collection. The output from that line is {{class org.hibernate.collection.internal.PersistentBag}}, which is some kind of runtime proxy according to [this|http://java.dzone.com/articles/jpa-lazy-loading] article, which retrieves all entities once firstly accessed.

Ken H., could you please confirm that the behavior align with your description ? Thanks.


                  
> pickList without collectionType results in failure to lazily load
> -----------------------------------------------------------------
>
>                 Key: RF-12608
>                 URL: https://issues.jboss.org/browse/RF-12608
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 4.2.3.Final, 4.3.0.M2
>            Reporter: Ken H
>            Assignee: Juraj Húska
>              Labels: regression, waiting_on_user
>
> Changes to the selectManyHelper class in 4.2.3+ causes a lazy loading exception in hibernate when the backing collection is persistent and is not eagerly loaded.
> The problem seems to be that fetching the collection in SelectManyHelper.getConvertedValue bypasses the PersistentSet getter that would normally issue the lazy load request.
> Defining the collectionType (e.g. java.util.ArrayList) bypasses this issue.
> Ideally this method would detect Hibernate proxy collections and handle them appropriately. However, I realize that may cause a dependency so perhaps it would be enough to document this option and situation in the component reference.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the richfaces-issues mailing list