[ 
https://issues.apache.org/jira/browse/OPENJPA-2500?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rick Curtis closed OPENJPA-2500.
--------------------------------

    Resolution: Not a Problem

I suspect that the reason that the lazy data fails to load is that without a 
transaction the persistence context gets cleared and your Entity gets detached. 
Lazy loading does not work (per the spec) with detached instances.... there is 
a feature (DelayCollectionLoading) that allows for collections to be loaded on 
a detached Entity, but I don't think that is the right solution for what you've 
encountered.

For future reference, please send questions like this to the users mailing 
list[1] rather than opening a bug.

Thanks,
Rick

[1] http://openjpa.apache.org/mailing-lists.html

> EJB Transaction Supports attribute causing JPA lazy fetching fails
> ------------------------------------------------------------------
>
>                 Key: OPENJPA-2500
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2500
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.2.2
>         Environment: windows 7, Weblogic 10.3.4(11g), SOAPUI 2.3.4, Java 
> 1.6.0.30, EJB 3.0
>            Reporter: Suresh
>            Priority: Minor
>
> I have an Enterprise Java Bean (EJB) called "A" and method called loadData 
> with EJB "A". 
> loadData method is marked with Supports Transaction attribute. 
> loadData method tries to load Employee Data from JPA domain and further lazy 
> fetches Department data and Employee Address Details. 
> The response has only Employee Data and does not have Department data and 
> Employee Address Details. 
> If I change EJB method "A" Transaction attribute to Required then all details 
> appear in the response. 
> Why is Transaction attribute Supports causing JPA lazy fetching fails?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to