Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 22821 invoked from network); 24 Feb 2007 02:13:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Feb 2007 02:13:27 -0000 Received: (qmail 31777 invoked by uid 500); 24 Feb 2007 02:13:36 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 31765 invoked by uid 99); 24 Feb 2007 02:13:36 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Feb 2007 18:13:36 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Feb 2007 18:13:26 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id CCFEB7140D1 for ; Fri, 23 Feb 2007 18:13:05 -0800 (PST) Message-ID: <25999101.1172283185837.JavaMail.jira@brutus> Date: Fri, 23 Feb 2007 18:13:05 -0800 (PST) From: "Matthew T. Adams (JIRA)" To: jdo-dev@db.apache.org Subject: [jira] Created: (JDO-467) Named PMF proposal / JDOHelper enhancements MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Named PMF proposal / JDOHelper enhancements ------------------------------------------- Key: JDO-467 URL: https://issues.apache.org/jira/browse/JDO-467 Project: JDO Issue Type: New Feature Components: api2, api2-legacy Affects Versions: JDO 2 maintenance release 1 Reporter: Matthew T. Adams >From the email on the expert group & jdo-dev alias: This is a proposal we discussed on the Fri Feb 23 JDO conf call. Please review and discuss. Overview: Currently, there is no way to bootstrap a JDO implementation completely externally to the source code. The developer is required to provide at least a resource name that identifies a java.util.Properties file on the classpath that can configure a single PMF. This makes deployment in different environments more challenging than necessary. Motivation: * Source code is required to be aware of external configuration: * In all current JDOHelper.getPersistenceManagerFactory APIs and * in order to configure listeners. * Aligns JDO bootstrapping with JPA bootstrapping concepts. Proposed Solution: * Introduce new API methods and JDO equivalent of the JPA persistence unit concepts, including a jdo.xml file that provides for the configuration of one or more named PMFs. Details: * PersistenceManagerFactory additions /** Returns the persistence unit name of this PMF. It's the JPA persistence unit name if configured via persistence.xml or the JDO persistence unit name if configured via javax.jdo.xml. */ public String getName(); * JDOHelper API additions /** The default name of the JDO configuration file. */ public static final String DEFAULT_JDO_CONFIG_RESOURCE_NAME = "javax.jdo.xml"; /** The name of the default persistence unit. */ public static final String DEFAULT_PMF_NAME = "default"; /** Gets the PMF named "default" in the resource "javax.jdo.xml" found via the current ClassLoader. */ public static PersistenceManagerFactory getPersistenceFactoryManager() { return getPersistenceFactoryManagerByName(DEFAULT_PMF_NAME); } /** Gets the PMF named pmfName in the resource "javax.jdo.xml" found via the current ClassLoader. */ public static PersistenceManagerFactory getPersistenceManagerFactoryByName(String pmfName) { return getPersistenceFactoryManagerByName(DEFAULT_PMF_NAME, DEFAULT_JDO_CONFIG_RESOURCE_NAME); } /** Gets the PMF named pmfName in the resource named resourceName found via the current ClassLoader. */ public static PersistenceManagerFactory getPersistenceManagerFactoryByName(String pmfName, String resourceName) { return getPersistenceFactoryManagerByName(DEFAULT_PMF_NAME, DEFAULT_JDO_CONFIG_RESOURCE_NAME, getClass().getClassLoader()); } /** Gets the PMF named pmfName in the resource named resourceName found via the current ClassLoader. */ public static PersistenceManagerFactory getPersistenceManagerFactoryByName(String pmfName, String resourceName, ClassLoader loader) { // reads resource resourceName via given loader // configures & returns PMF with the given name } * Possibilities for DEFAULT_JDO_CONFIG_RESOURCE_NAME value: need to determine file name (similar to persistence.xml) javax.jdo.xml jdo.xml ... * Proposal for JDO persistence unit configuration XML file * Could be more like Spring beans.xml (supporting references, etc.) * Note: Square brackets indicate optional elements/attributes [ elements wherever appropriate] [resource="..."] [class="xcalia.ic.jdo.PersistenceManagerFactory"] [connection-driver="..."] [connection-url="..."] [connection-user-name="..."] [connection-password="..."] [...] > [] [] [] [...] [] [] [...] -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.