Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 51144 invoked from network); 16 Feb 2007 23:48:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Feb 2007 23:48:07 -0000 Received: (qmail 24738 invoked by uid 500); 16 Feb 2007 23:48:15 -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 24727 invoked by uid 99); 16 Feb 2007 23:48:15 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Feb 2007 15:48:15 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [192.18.42.249] (HELO nwk-ea-fw-1.sun.com) (192.18.42.249) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Feb 2007 15:48:03 -0800 Received: from d1-sfbay-09.sun.com ([192.18.39.119]) by nwk-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id l1GNlb6F027511 for ; Fri, 16 Feb 2007 15:47:37 -0800 (PST) Received: from conversion-daemon.d1-sfbay-09.sun.com by d1-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JDK00L01Y0TSZ00@d1-sfbay-09.sun.com> (original mail from Craig.Russell@Sun.COM) for jdo-dev@db.apache.org; Fri, 16 Feb 2007 15:47:37 -0800 (PST) Received: from [129.145.133.119] by d1-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JDK00CTDY3C0580@d1-sfbay-09.sun.com> for jdo-dev@db.apache.org; Fri, 16 Feb 2007 15:47:36 -0800 (PST) Date: Fri, 16 Feb 2007 15:47:33 -0800 From: Craig L Russell Subject: Re: [VOTE] Changes to PersistenceManagerFactory In-reply-to: <1E1DC1D9-B513-43D5-A54B-3D98E2E31787@SUN.com> Sender: Craig.Russell@Sun.COM To: jdo-dev@db.apache.org Cc: JDO Expert Group Message-id: <59922D85-E7FF-416A-A086-661EC30E95DB@SUN.com> MIME-version: 1.0 X-Mailer: Apple Mail (2.752.2) Content-type: multipart/signed; protocol="application/pkcs7-signature"; boundary=Apple-Mail-201-88927103; micalg=sha1 References: <1E1DC1D9-B513-43D5-A54B-3D98E2E31787@SUN.com> X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-201-88927103 Content-Type: multipart/alternative; boundary=Apple-Mail-199-88925930 --Apple-Mail-199-88925930 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed For your convenience, the relevant patch is attached to this message. Craig =EF=BF=BC On Feb 16, 2007, at 9:04 AM, Craig L Russell wrote: > Please approve the changes to PersistenceManager and =20 > PersistenceManagerFactory as documented in https://=20 > issues.apache.org/jira/browse/JDO-449 https://issues.apache.org/=20 > jira/browse/JDO-445 and https://issues.apache.org/jira/browse/JDO-462. > > Craig Russell > Architect, Sun Java Enterprise System http://java.sun.com/products/jdo > 408 276-5638 mailto:Craig.Russell@sun.com > P.S. A good JDO? O, Gasp! > Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:Craig.Russell@sun.com P.S. A good JDO? O, Gasp! --Apple-Mail-199-88925930 Content-Type: multipart/mixed; boundary=Apple-Mail-200-88925931 --Apple-Mail-200-88925931 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=US-ASCII For your convenience, the relevant patch is attached to this message.

Craig

--Apple-Mail-200-88925931 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name=JDO-445.patch Content-Disposition: attachment; filename=JDO-445.patch Index: src/java/javax/jdo/PersistenceManager.java =================================================================== --- src/java/javax/jdo/PersistenceManager.java (revision 497582) +++ src/java/javax/jdo/PersistenceManager.java (working copy) @@ -23,6 +23,7 @@ package javax.jdo; import java.util.Collection; +import java.util.Date; import javax.jdo.datastore.JDOConnection; import javax.jdo.datastore.Sequence; @@ -37,7 +38,7 @@ *

A PersistenceManager is obtained from the * {@link PersistenceManagerFactory} * (recommended) or by construction. - * @version 2.0 + * @version 2.1 */ public interface PersistenceManager { @@ -1084,4 +1085,16 @@ * @since 2.0 */ void removeInstanceLifecycleListener (InstanceLifecycleListener listener); + + /** + * Get the Date as seen by the server. + * Clients using this method can order their operations according to + * a single time source. Implementations use the setting of the + * server time zone to prepare a Date instance that represents + * UTC time on the server. + * @return a Date instance corresponding to the UTC Date + * as seen by the server + * @since 2.1 + */ + Date getServerDate(); } Index: src/java/javax/jdo/PersistenceManagerFactory.java =================================================================== --- src/java/javax/jdo/PersistenceManagerFactory.java (revision 497582) +++ src/java/javax/jdo/PersistenceManagerFactory.java (working copy) @@ -51,10 +51,24 @@ *

Operational state (PersistenceManager pooling, connection * pooling, operational parameters) must not be serialized. * - * @version 2.0 + * @version 2.1 */ public interface PersistenceManagerFactory extends java.io.Serializable { + + /** + * The value for TransactionType to specify that transactions + * are managed by the Java Transactions API, as documented in + * JSR-220. + */ + public static final String JTA = "JTA"; + + /** + * The value for TransactionType to specify that transactions + * are managed by the javax.jdo.Transaction instance, similar + * to the usage as documented in JSR-220. + */ + public static final String RESOURCE_LOCAL = "RESOURCE_LOCAL"; /** Close this PersistenceManagerFactory. Check for * JDOPermission("closePersistenceManagerFactory") and if not authorized, @@ -94,6 +108,29 @@ */ PersistenceManager getPersistenceManager(); + /** Get a thread-safe instance of a proxy that dynamically binds + * on each method call to an instance of PersistenceManager. + *

When used with a PersistenceManagerFactory + * that uses TransactionType JTA, + * the proxy can be used in a server to dynamically bind to an instance + * from this factory associated with the thread's current transaction. + * In this case, the close method is ignored, as the + * PersistenceManager is automatically closed when the + * transaction completes. + *

When used with a PersistenceManagerFactory + * that uses TransactionType RESOURCE_LOCAL, the proxy uses an inheritable + * ThreadLocal to bind to an instance of PersistenceManager + * associated with the thread. In this case, the close method executed + * on the proxy closes the PersistenceManager and then + * clears the ThreadLocal. + * Use of this method does not affect the configurability of the + * PersistenceManagerFactory. + * + * @since 2.1 + * @return a PersistenceManager proxy. + */ + PersistenceManager getPersistenceManagerProxy(); + /** Get an instance of PersistenceManager from this factory. * The instance has default values for options. * The parameters userid and password are used @@ -329,9 +366,81 @@ * factory. * @see #getDetachAllOnCommit() * @since 2.0 + * @param flag the default DetachAllOnCommit setting */ void setDetachAllOnCommit(boolean flag); - + + + /** + * Sets the PersistenceUnitName for this PersistenceManagerFactory. + * This has the same semantics as the same-named property in + * JSR-220 PersistenceUnitInfo. + * @see #getPersistenceUnitName() + * @since 2.1 + * @param name the PersistenceUnitName + */ + void setPersistenceUnitName(String name); + + /** + * Gets the PersistenceUnitName for this PersistenceManagerFactory. + * @see #setPersistenceUnitName(String) + * @since 2.1 + * @return the PersistenceUnitName + */ + String getPersistenceUnitName(); + + /** + * Sets the TimeZone ID of the server associated with this + * PersistenceManagerFactory. The parameter is a String + * suitable for use with TimeZone.getTimeZone(). The String + * must match an ID returned by TimeZone.getAvailableIDs(). + * If the ServerTimeZoneID is not set, or set to the null String, + * assume that the server has the same TimeZone ID as the client. + * If incorrectly set, the result of PersistenceManager.getServerDate() + * might be incorrect. + * @see #getServerTimeZoneID() + * @see java.util.TimeZone#getTimeZone(String) + * @see java.util.TimeZone#getAvailableIDs() + * @see PersistenceManager#getServerDate() + * @since 2.1 + * @param timezoneid the TimeZone ID of the server + * @throws JDOUserException if the parameter does not match + * an ID from TimeZone.getAvailableIDs() + */ + void setServerTimeZoneID(String timezoneid); + + /** + * Gets the TimeZone ID of the server associated with this + * PersistenceManagerFactory. If not set, assume that + * the server has the same TimeZone ID as the client. + * @see #setServerTimeZoneID(String) + * @since 2.1 + * @return the TimeZone of the server + */ + String getServerTimeZoneID(); + + /** + * Sets the TransactionType for this PersistenceManagerFactory. + * Permitted values are "JTA" and "RESOURCE_LOCAL". + * This has the same semantics as the same-named property in + * JSR-220 EntityManagerFactory. + * @see #getTransactionType() + * @see #JTA + * @see #RESOURCE_LOCAL + * @since 2.1 + * @param name the TransactionType + * @throws JDOUserException if the parameter is not a permitted value + */ + void setTransactionType(String name); + + /** + * Gets the TransactionType for this PersistenceManagerFactory. + * @see #setTransactionType(String) + * @since 2.1 + * @return the TransactionType + */ + String getTransactionType(); + /** Return non-configurable properties of this * PersistenceManagerFactory. * Properties with keys VendorName and @@ -388,6 +497,7 @@ * a second-level cache, the returned instance does nothing. This * method never returns null. * @since 2.0 + * @return the DataStoreCache */ DataStoreCache getDataStoreCache (); --Apple-Mail-200-88925931 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1

Please approve the changes to PersistenceManager and = PersistenceManagerFactory as documented in=A0https://issues.apac= he.org/jira/browse/JDO-449=A0https://issues.apac= he.org/jira/browse/JDO-445 and=A0https://issues.apac= he.org/jira/browse/JDO-462.

Craig = Russell
Architect, Sun Java = Enterprise System http://java.sun.com/products/jdo=
P.S. A good JDO? O, = Gasp!


Craig Russell

Architect, Sun Java = Enterprise System http://java.sun.com/products/jdo=

408 = 276-5638 mailto:Craig.Russell@sun.com

P.S. A = good JDO? O, Gasp!


= --Apple-Mail-200-88925931-- --Apple-Mail-199-88925930-- --Apple-Mail-201-88927103 Content-Transfer-Encoding: base64 Content-Type: application/pkcs7-signature; name=smime.p7s Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGUDCCAwkw ggJyoAMCAQICECpJVMO68ii+Xfsc1O1YYFIwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbC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