openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Dick (JIRA)" <>
Subject [jira] [Commented] (OPENJPA-2037) Queries with nullable parameters discontinue to return data
Date Thu, 28 Jul 2011 14:14:09 GMT


Michael Dick commented on OPENJPA-2037:

If you disable the QuerySQLCache, do you still see the problem? 

You can disable it by adding this property to persistence.xml : 
<property name="openjpa.jdbc.QuerySQLCache" value="false"/>

> Queries with nullable parameters discontinue to return data
> -----------------------------------------------------------
>                 Key: OPENJPA-2037
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.1.1
>            Reporter: Sergey Razuvaev
>         Attachments: execution_log.txt, jpa_config.txt, table_ scheme.GIF
> We have a hierarchical table CT_LOCATION (database scheme and corresponding jpa configuration
are placed into table_scheme.gif and jpa_config.txt attachments)
> There is a JPQL-query to get children by a parent location:
>     <named-query name="locationManagement.getLocations">
> 		<query>select item from Location item where = :locationSuperLocationId</query>
>     </named-query>
> The parameter locationSuperLocationId can be set to NULL to return all root locations.
When we use following execution sequence the query discontinues to return root items:
> Step 1: Set locationSuperLocationId to NULL and get all root elements. Query result is
> Step 2: Fill locationSuperLocationId with actual parent id and execute query. Repeat
this step TWO OR MORE TIMES.
> Step 3: Set locationSuperLocationId to NULL again and get all root elements. The query
result will be EMPTY.
> On step 1 openjpa uses IS NULL construction to get data from the database. But on step
3 it does not. Execution log is placed in to execution_log.txt atachment.

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message