openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Dick (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-2001) JPQL queries with IN expression are not cached
Date Mon, 23 May 2011 19:11:47 GMT

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

Michael Dick commented on OPENJPA-2001:
---------------------------------------

Well, the reason is that these queries didn't work. It was originally reported in OPENJPA-1845
(which was fixed in OpenJPA 2.1.0). 

Omitting these queries may impact performance - depending on your application. 

I'm not sufficiently familiar with the prepared SQL cache to comment on how easy, hard, or
impossible, it is to handle queries with an IN expression, but I think we'd be interested
in and accept a patch for trunk. 

> JPQL queries with IN expression are not cached
> ----------------------------------------------
>
>                 Key: OPENJPA-2001
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2001
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: jpa
>    Affects Versions: 2.1.0
>            Reporter: Dimitrios Iosifidis
>
> While executing the query: SELECT t FROM TestOpenJpaPO AS t WHERE t.nodeType  in :nodeType
> i have noticed at OPENJPA logs that the query is not cached due to the fact that contains
the IN expression.
> 2011-05-16 14:53:34,187 DEBUG [openjpa.Runtime] org.apache.openjpa.persistence.EntityManagerFactoryImpl@7b3f7b3f
created EntityManager org.apache.openjpa.persistence.EntityManagerImpl@60726072.
> 2011-05-16 14:53:34,234 DEBUG [openjpa.Runtime] Query "SELECT t FROM TestOpenJpaPO AS
t WHERE t.nodeType  in :nodeType" is cached."	
> 2011-05-16 14:53:34,234 DEBUG [openjpa.Query] Executing query: [SELECT t FROM TestOpenJpaPO
AS t WHERE t.nodeType  in :nodeType] with parameters: ?
> 2011-05-16 14:53:34,234 DEBUG [openjpa.jdbc.SQL] <t 1194084140, conn 1095057733>
executing prepstmnt 1267026821 SELECT t0.UUIDKEY, t0.NODEGROUP, t0.NODENAME, t0.NODETYPE,
t0.PRODUCTID FROM SYMTEST.TESTOPENJPA t0 WHERE (t0.NODETYPE IN (?, ?)) [params=?, ?]
> 2011-05-16 14:53:34,250 DEBUG [openjpa.jdbc.SQL] <t 1194084140, conn 1095057733>
[16 ms] spent
> 2011-05-16 14:53:34,250 WARN  [openjpa.Runtime] Query "SELECT t FROM TestOpenJpaPO AS
t WHERE t.nodeType  in :nodeType" is removed from cache  excluded permanently. Query "SELECT
t FROM TestOpenJpaPO AS t WHERE t.nodeType  in :nodeType" is not cached because it uses IN
expression with variable-length parameter..
> Is there a reason for this? I guess it might affect performance. 
> Can you please include this type of JPQL queries in the cache?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message