From dev-return-20948-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 13 15:15:11 2012 Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9FA4F9633 for ; Thu, 13 Sep 2012 15:15:09 +0000 (UTC) Received: (qmail 11672 invoked by uid 500); 13 Sep 2012 15:15:08 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 11574 invoked by uid 500); 13 Sep 2012 15:15:08 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 11197 invoked by uid 99); 13 Sep 2012 15:15:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Sep 2012 15:15:07 +0000 Date: Fri, 14 Sep 2012 02:15:07 +1100 (NCT) From: "Jody Grassel (JIRA)" To: dev@openjpa.apache.org Message-ID: <1012171511.75137.1347549307701.JavaMail.jiratomcat@arcas> In-Reply-To: <522651102.58484.1347295927934.JavaMail.jiratomcat@arcas> Subject: [jira] [Resolved] (OPENJPA-2261) Query SQL Cache issue with NULL parameters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-2261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jody Grassel resolved OPENJPA-2261. ----------------------------------- Resolution: Fixed Fix Version/s: 2.2.1 2.3.0 2.1.2 > Query SQL Cache issue with NULL parameters > ------------------------------------------ > > Key: OPENJPA-2261 > URL: https://issues.apache.org/jira/browse/OPENJPA-2261 > Project: OpenJPA > Issue Type: Bug > Components: query > Affects Versions: 2.1.0, 2.1.1, 2.2.0 > Reporter: Jody Grassel > Assignee: Jody Grassel > Fix For: 2.1.2, 2.3.0, 2.2.1 > > > The Query SQL Cache matches previously executed SQL for a given JPQL by using the JPQL string itself for the key. As long as none of the predicate parameters are NULL, this is fine, as the prepared statement's SQL remains unchanged. Since SQL requires "column IS NULL" statements and not "column = NULL", the approach used by OpenJPA's Query SQL Cache breaks and results with bad getResultList() returns. > In the future (say, trunk), the Query SQL Cache needs more intelligence to handle this situation, but for service releases the best way to handle this issue is to disqualify queries with NULL parameters from the query cache. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira