openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Lee (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-2508) LEFT JOIN FETCH not honored when data cache is enabled
Date Thu, 29 May 2014 14:23:02 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14012395#comment-14012395
] 

Albert Lee commented on OPENJPA-2508:
-------------------------------------

The test case call doQuery() twice, i.e. same call path.  The first call executes the SQLs
and fetches Dept and Employee from the db. Both dept and employee were cached.  The second
call the Employee was fetched from cache but the Employee.dept remains null even the SQL requests
to load dept using "join fetch dept".

The attached test will pass (Employee.dept is loaded; not null) if either:
1) the Employee.dept is marked FetchType.EAGER, or
2) TestNPE2.doquery().... em.detach(emp) is removed.

> LEFT JOIN FETCH not honored when data cache is enabled
> ------------------------------------------------------
>
>                 Key: OPENJPA-2508
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2508
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache
>    Affects Versions: 2.2.2, 2.2.1.1
>            Reporter: Albert Lee
>         Attachments: OPENJPA-2508.test.zip
>
>
> In a simple JPQL with left join fetch for a lazy loaded association specified and data
cached enabled, first time the query executed, the lazy loaded association get loaded, returned
and cached. Subsequent invocation of the same query does NOT "load" and return the association
from the query invocation.
> I'll attach a test case to reproduce the problem.



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

Mime
View raw message