You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Albert Lee (Closed) (JIRA)" <ji...@apache.org> on 2012/02/02 17:58:51 UTC

[jira] [Closed] (OPENJPA-1845) the prepared query cache doesn't currently work correclty with 'SELECT IN' statements

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

Albert Lee closed OPENJPA-1845.
-------------------------------


Close issue in preparation for 2.2.0 release.
                
> the prepared query cache doesn't currently work correclty with 'SELECT IN' statements
> -------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1845
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1845
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 2.0.1
>            Reporter: Mark Struberg
>            Assignee: Pinaki Poddar
>            Priority: Critical
>             Fix For: 2.1.1, 2.2.0
>
>
> I have a problem with upgrading from OpenJPA-2.0.0 to 2.0.1.
> One of my services executes the following query (this is the 'id' I get in PreparedQueryCacheImpl#get(String id) ):
> SELECT distinct e FROM Employment em, Person e WHERE em.employeeId = e.employeeId and em.orgUnitCode = :orgUnitCode AND em.employmentPosition in (:employmentPositions) AND em.start <= :startBefore AND em.end >= :endAfter ORDER BY e.familyName ASC
> Somehow when I execute my service a few times with different employmentPositions params (ArrayList<String>) I still get the 'old' cached param values!
> I tried to disable this behaviour in my persistence.xml with
>   <property name="openjpa.QueryCache" value="false"/>
> but this didn't work.
> Maybe this was a side effect of the ORDER BY which made this query work in 2.0.0 (caching of queries with ORDER BY got only fixed after 2.0.0), so I'd like to write a unit test for it.
> As Jeremy pointed out, this can get fixed by setting <property name="openjpa.jdbc.QuerySQLCache" value="false"/> in my persistence.xml.
> Nontheless this is a problematic bug because it is very hard to find and lead to finding wrong data in your application (would be less problematic if it would 'just' throw an Exception).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira