Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 16921 invoked from network); 26 Oct 2010 18:36:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Oct 2010 18:36:48 -0000 Received: (qmail 57427 invoked by uid 500); 26 Oct 2010 18:36:47 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 57398 invoked by uid 500); 26 Oct 2010 18:36:47 -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 57390 invoked by uid 99); 26 Oct 2010 18:36:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Oct 2010 18:36:47 +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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Oct 2010 18:36:45 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o9QIaN7H022605 for ; Tue, 26 Oct 2010 18:36:23 GMT Message-ID: <17965530.84461288118183756.JavaMail.jira@thor> Date: Tue, 26 Oct 2010 14:36:23 -0400 (EDT) From: "Rick Curtis (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-1855) OpenJPA shouldn't silently ignore an invalid javax.persistence.xxxx configuration property In-Reply-To: <10873939.82111288111340340.JavaMail.jira@thor> 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-1855?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Curtis updated OPENJPA-1855: --------------------------------- Attachment: OPENJPA-1855.patch The change I'm proposing entails logging a WARNING message anytime "javax.persistence.cache.retrieveMode" or "javax.persistence.cache.storeMode" in encountered. I went back and forth with TRACE vs WARN and I think WARN is the correct direction. This can easily be extended to other javax.persistence.[xx] properties that can't be configured at the provider level. The message looks something like this : 16 test WARN [main] openjpa.Runtime - The property "javax.persistence.cache.storeMode=BYPASS" was detected while loading configuration. However, it is invalid and cannot be configured at the provider level, so it is ignored. Please consult the documentation for the correct usage of this property. > OpenJPA shouldn't silently ignore an invalid javax.persistence.xxxx configuration property > ------------------------------------------------------------------------------------------ > > Key: OPENJPA-1855 > URL: https://issues.apache.org/jira/browse/OPENJPA-1855 > Project: OpenJPA > Issue Type: Improvement > Components: logging > Reporter: Rick Curtis > Assignee: Rick Curtis > Priority: Minor > Attachments: OPENJPA-1855.patch > > > While I was working on a unit test I had the following property set and it was being silently ignored by the runtime. After digging around a bunch, I figured out that it is actually an invalid configuration. I can specify this property on em.setProperty(...)[3.7.2], but I can't set a 'default' value at the provider(emf) level. > > [3.7.2] - > Cache retrieve mode and cache store mode properties may be specified at the level of the persistence > context by means of the EntityManager setProperty method. These properties may be specified for > the EntityManager find and refresh methods and the Query and TypedQuery setHint methods. > Cache retrieve mode and/or cache store mode properties specified for the find, refresh, and > Query and TypedQuery setHint methods override those specified for the persistence context for > the specified find and refresh invocations, and for the execution of the specified queries respectively. > With this JIRA I want to detect *some* of the invalid configurations and log a .... [INFO,WARN,TRACE]? message. Per the spec (8.2.1.9) "If a persistence provider does not recognize a property (other than a property defined by this specification), the provider must ignore it." I believe this gives us the leeway to do something about the condition that I ran into. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.