Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 58977 invoked from network); 16 Mar 2010 09:57:49 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Mar 2010 09:57:49 -0000 Received: (qmail 80023 invoked by uid 500); 16 Mar 2010 09:57:49 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 79945 invoked by uid 500); 16 Mar 2010 09:57:49 -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 79935 invoked by uid 99); 16 Mar 2010 09:57:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Mar 2010 09:57:48 +0000 X-ASF-Spam-Status: No, hits=-1025.9 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Mar 2010 09:57:47 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9378E234C48C for ; Tue, 16 Mar 2010 09:57:27 +0000 (UTC) Message-ID: <1109026365.286951268733447603.JavaMail.jira@brutus.apache.org> Date: Tue, 16 Mar 2010 09:57:27 +0000 (UTC) From: "Oliver Ringel (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-1577) Using @Strategy in Queries not working properly In-Reply-To: <9801298.286931268733327537.JavaMail.jira@brutus.apache.org> 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-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oliver Ringel updated OPENJPA-1577: ----------------------------------- Attachment: openjpa1577.tar Here is the test case. > Using @Strategy in Queries not working properly > ----------------------------------------------- > > Key: OPENJPA-1577 > URL: https://issues.apache.org/jira/browse/OPENJPA-1577 > Project: OpenJPA > Issue Type: Bug > Affects Versions: 2.0.0-beta2 > Environment: Ubuntu 9.10, Maven 2.2.1, Spring 3.0.1 > Reporter: Oliver Ringel > Attachments: openjpa1577.tar > > > I try to use a field that is annotated with @Strategy in a Query. > I expected that everytime the query is executed the toDataStoreValue method of the ValueHandler is called to prepare the correct values for the SQL query. > This is only happens once. The next time the Query is executed the ValueHandler is not called. > Here is the interesting part of the logging > 1st call: > [DEBUG,Query,main] Executing query: [select s from SimpleEntity s where s.base = :base and s.name = :name] with parameters: {name=james, base=1} > toDataStoreValue: 1 > [DEBUG,SQL,main] executing prepstmnt 1531692262 SELECT t0.id, t0.version, t0.base, t0.street, t0.my_name FROM some_objects t0 WHERE (t0.base = ? AND t0.my_name = ?) [params=(String) base1, (String) james] > 2nd call: > [DEBUG,Query,main] Executing query: [select s from SimpleEntity s where s.base = :base and s.name = :name] with parameters: {0=2, 1=henry} > [DEBUG,SQL,main] executing prepstmnt 106030716 SELECT t0.id, t0.version, t0.base, t0.street, t0.my_name FROM some_objects t0 WHERE (t0.base = ? AND t0.my_name = ?) [params=(String) 2, (String) henry] > You can see that the parameter list has changed after the first call. Some kind of transformation (caching?) prevents calling the ValueHandler again. > This is only a vague presumption. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.