From dev-return-15731-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Tue Mar 16 23:45:51 2010 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 31838 invoked from network); 16 Mar 2010 23:45:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Mar 2010 23:45:51 -0000 Received: (qmail 42646 invoked by uid 500); 16 Mar 2010 23:45:51 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 42614 invoked by uid 500); 16 Mar 2010 23:45:51 -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 42606 invoked by uid 99); 16 Mar 2010 23:45:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Mar 2010 23:45:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED 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 23:45:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7CD36234C4AE for ; Tue, 16 Mar 2010 23:45:27 +0000 (UTC) Message-ID: <783512156.303641268783127510.JavaMail.jira@brutus.apache.org> Date: Tue, 16 Mar 2010 23:45:27 +0000 (UTC) From: "Fay Wang (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (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 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846215#action_12846215 ] Fay Wang commented on OPENJPA-1577: ----------------------------------- Hi Oliver, can you try to see if it works for your query? > 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 > Assignee: Fay Wang > Attachments: OPENJPA-1577-1.patch, OPENJPA-1577.patch, 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.