db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r916585 - in /db/jdo/trunk: api2/src/java/javax/jdo/ api2/src/schema/javax/jdo/ tck2/src/conf/ tck2/src/java/org/apache/jdo/tck/ tck2/src/java/org/apache/jdo/tck/api/persistencemanager/
Date Fri, 26 Feb 2010 06:32:05 GMT
Author: clr
Date: Fri Feb 26 06:32:05 2010
New Revision: 916585

URL: http://svn.apache.org/viewvc?rev=916585&view=rev
Log:
JDO-623 Update signatures and constants for Datastore timeout

Modified:
    db/jdo/trunk/api2/src/java/javax/jdo/Constants.java
    db/jdo/trunk/api2/src/java/javax/jdo/JDOHelper.java
    db/jdo/trunk/api2/src/schema/javax/jdo/jdoconfig_2_3.dtd
    db/jdo/trunk/api2/src/schema/javax/jdo/jdoconfig_2_3.xsd
    db/jdo/trunk/api2/src/schema/javax/jdo/jdoquery_2_3.dtd
    db/jdo/trunk/api2/src/schema/javax/jdo/jdoquery_2_3.xsd
    db/jdo/trunk/tck2/src/conf/jdo-2_3-signatures.txt
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/JDO_Test.java
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/api/persistencemanager/DatastoreTimeout.java

Modified: db/jdo/trunk/api2/src/java/javax/jdo/Constants.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/Constants.java?rev=916585&r1=916584&r2=916585&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/Constants.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/Constants.java Fri Feb 26 06:32:05 2010
@@ -268,13 +268,20 @@
         = "server-time-zone-id";
     /**
      * The name of the persistence manager factory element's
-     * "query-timeout-millis" attribute.
+     * "datastore-read-timeout-millis" attribute.
      *
      * @since 2.3
      */
-    static String PMF_ATTRIBUTE_QUERY_TIMEOUT
-        = "query-timeout-millis";
-
+    static String PMF_ATTRIBUTE_DATASTORE_READ_TIMEOUT_MILLIS
+        = "datastore-read-timeout-millis";
+    /**
+     * The name of the persistence manager factory element's
+     * "datastore-write-timeout-millis" attribute.
+     *
+     * @since 2.3
+     */
+    static String PMF_ATTRIBUTE_DATASTORE_WRITE_TIMEOUT_MILLIS
+        = "datastore-write-timeout-millis";
     /**
      * The name of the persistence manager factory property elements in the JDO
      * configuration file.
@@ -475,6 +482,14 @@
     static String OPTION_QUERY_SQL
         = "javax.jdo.query.SQL";
     /**
+     * "javax.jdo.option.QueryCancel"
+     *
+     * @see PersistenceManagerFactory#supportedOptions()
+     * @since 2.3
+     */
+    static String OPTION_QUERY_CANCEL
+        = "javax.jdo.option.QueryCancel";
+    /**
      * "javax.jdo.option.DatastoreTimeout"
      *
      * @see PersistenceManagerFactory#supportedOptions()
@@ -860,30 +875,40 @@
         = "javax.jdo.mapping.Schema";
 
     /**
-     * Mapping "javax.jdo.option.ServerTimeZoneID"
+     * Specified value "javax.jdo.option.ServerTimeZoneID"
      *
      * @since 2.1
      */
     static String PROPERTY_SERVER_TIME_ZONE_ID
         = "javax.jdo.option.ServerTimeZoneID";
+
     /**
-     * Mapping "javax.jdo.option.QueryTimeoutMillis"
+     * Specified value "javax.jdo.option.DatastoreReadTimeoutMillis"
      *
      * @since 2.3
      */
-    static String PROPERTY_QUERY_TIMEOUT
-        = "javax.jdo.option.QueryTimeoutMillis";
+    static String PROPERTY_DATASTORE_READ_TIMEOUT_MILLIS
+        = "javax.jdo.option.DatastoreReadTimeoutMillis";
 
     /**
-     * Nonconfigurable property constanct "VendorName"
+     * Specified value "javax.jdo.option.DatastoreWriteTimeoutMillis"
+     *
+     * @since 2.3
+     */
+    static String PROPERTY_DATASTORE_WRITE_TIMEOUT_MILLIS
+        = "javax.jdo.option.DatastoreWriteTimeoutMillis";
+
+    /**
+     * Nonconfigurable property constant "VendorName"
      *
      * @see PersistenceManagerFactory#getProperties()
      * @since 2.1
      */
     static String NONCONFIGURABLE_PROPERTY_VENDOR_NAME
         = "VendorName";
+
     /**
-     * Nonconfigurable property constanct "VersionNumber"
+     * Nonconfigurable property constant "VersionNumber"
      *
      * @see PersistenceManagerFactory#getProperties()
      * @since 2.1

Modified: db/jdo/trunk/api2/src/java/javax/jdo/JDOHelper.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/JDOHelper.java?rev=916585&r1=916584&r2=916585&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/JDOHelper.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/JDOHelper.java Fri Feb 26 06:32:05 2010
@@ -163,8 +163,11 @@
             PMF_ATTRIBUTE_SERVER_TIME_ZONE_ID,
             PROPERTY_SERVER_TIME_ZONE_ID);
         xref.put(
-            PMF_ATTRIBUTE_QUERY_TIMEOUT,
-            PROPERTY_QUERY_TIMEOUT);
+                PMF_ATTRIBUTE_DATASTORE_READ_TIMEOUT_MILLIS,
+                PROPERTY_DATASTORE_READ_TIMEOUT_MILLIS);
+        xref.put(
+                PMF_ATTRIBUTE_DATASTORE_WRITE_TIMEOUT_MILLIS,
+                PROPERTY_DATASTORE_WRITE_TIMEOUT_MILLIS);
 
         return Collections.unmodifiableMap(xref);
     }

Modified: db/jdo/trunk/api2/src/schema/javax/jdo/jdoconfig_2_3.dtd
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/schema/javax/jdo/jdoconfig_2_3.dtd?rev=916585&r1=916584&r2=916585&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/schema/javax/jdo/jdoconfig_2_3.dtd (original)
+++ db/jdo/trunk/api2/src/schema/javax/jdo/jdoconfig_2_3.dtd Fri Feb 26 06:32:05 2010
@@ -43,6 +43,8 @@
 <!ATTLIST persistence-manager-factory mapping CDATA #IMPLIED>
 <!ATTLIST persistence-manager-factory detach-all-on-commit (true|false) CDATA #IMPLIED>
 <!ATTLIST persistence-manager-factory server-time-zone-id CDATA #IMPLIED>
+<!ATTLIST persistence-manager-factory datastore-read-timeout-millis CDATA #IMPLIED>
+<!ATTLIST persistence-manager-factory datastore-write-timeout-millis CDATA #IMPLIED>
 
 <!ELEMENT property EMPTY>
 <!ATTLIST property name CDATA #REQUIRED>

Modified: db/jdo/trunk/api2/src/schema/javax/jdo/jdoconfig_2_3.xsd
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/schema/javax/jdo/jdoconfig_2_3.xsd?rev=916585&r1=916584&r2=916585&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/schema/javax/jdo/jdoconfig_2_3.xsd (original)
+++ db/jdo/trunk/api2/src/schema/javax/jdo/jdoconfig_2_3.xsd Fri Feb 26 06:32:05 2010
@@ -149,6 +149,10 @@
     <xs:attribute name="detach-all-on-commit" use="optional"/>
     <!-- Corresponds to standard JDO property javax.jdo.option.ServerTimeZoneID. -->
     <xs:attribute name="server-time-zone-id" use="optional"/>
+    <!-- Corresponds to standard JDO property javax.jdo.option.DatastoreReadTimeoutMillis.
-->
+    <xs:attribute name="datastore-read-timeout-millis" use="optional"/>
+    <!-- Corresponds to standard JDO property javax.jdo.option.DatastoreWriteTimeoutMillis.
-->
+    <xs:attribute name="datastore-write-timeout-millis" use="optional"/>
     <!-- Any other vendor-specific attributes are allowed and passed literally 
         to the underlying implementation. -->
     <xs:anyAttribute processContents="lax"/>

Modified: db/jdo/trunk/api2/src/schema/javax/jdo/jdoquery_2_3.dtd
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/schema/javax/jdo/jdoquery_2_3.dtd?rev=916585&r1=916584&r2=916585&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/schema/javax/jdo/jdoquery_2_3.dtd (original)
+++ db/jdo/trunk/api2/src/schema/javax/jdo/jdoquery_2_3.dtd Fri Feb 26 06:32:05 2010
@@ -36,6 +36,8 @@
 <!ATTLIST query unmodifiable (true|false) 'false'>
 <!ATTLIST query unique (true|false) #IMPLIED>
 <!ATTLIST query result-class CDATA #IMPLIED>
+<!ATTLIST query datastore-read-timeout-millis CDATA #IMPLIED>
+<!ATTLIST query datastore-write-timeout-millis CDATA #IMPLIED>
 
 <!ELEMENT extension ANY>
 <!ATTLIST extension vendor-name CDATA #REQUIRED>

Modified: db/jdo/trunk/api2/src/schema/javax/jdo/jdoquery_2_3.xsd
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/schema/javax/jdo/jdoquery_2_3.xsd?rev=916585&r1=916584&r2=916585&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/schema/javax/jdo/jdoquery_2_3.xsd (original)
+++ db/jdo/trunk/api2/src/schema/javax/jdo/jdoquery_2_3.xsd Fri Feb 26 06:32:05 2010
@@ -93,6 +93,8 @@
             </xs:simpleType>
         </xs:attribute>
         <xs:attribute name="result-class"/>
+        <xs:attribute name="datastore-read-timeout-millis"/>
+        <xs:attribute name="datastore-write-timeout-millis"/>
     </xs:attributeGroup>
     <xs:element name="extension">
         <xs:complexType>

Modified: db/jdo/trunk/tck2/src/conf/jdo-2_3-signatures.txt
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/jdo-2_3-signatures.txt?rev=916585&r1=916584&r2=916585&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/conf/jdo-2_3-signatures.txt (original)
+++ db/jdo/trunk/tck2/src/conf/jdo-2_3-signatures.txt Fri Feb 26 06:32:05 2010
@@ -74,8 +74,10 @@
         = "mapping";
     static String PMF_ATTRIBUTE_SERVER_TIME_ZONE_ID
         = "server-time-zone-id";
-    static String PMF_ATTRIBUTE_QUERY_TIMEOUT
-        = "query-timeout-millis";
+    static String PMF_ATTRIBUTE_DATASTORE_READ_TIMEOUT_MILLIS
+        = "datastore-read-timeout-millis";
+    static String PMF_ATTRIBUTE_DATASTORE_WRITE_TIMEOUT_MILLIS
+        = "datastore-write-timeout-millis";
     static String ELEMENT_PROPERTY
         = "property";
     static String PROPERTY_ATTRIBUTE_NAME
@@ -130,6 +132,8 @@
         = "javax.jdo.option.DatastoreTimeout";
     static String OPTION_QUERY_SQL
         = "javax.jdo.query.SQL";
+    static String OPTION_QUERY_CANCEL
+        = "javax.jdo.option.QueryCancel";
     static String OPTION_UNCONSTRAINED_QUERY_VARIABLES
         = "javax.jdo.option.UnconstrainedQueryVariables";
     static String OPTION_VERSION_DATETIME
@@ -214,8 +218,10 @@
         = "javax.jdo.mapping.Schema";
     static String PROPERTY_SERVER_TIME_ZONE_ID
         = "javax.jdo.option.ServerTimeZoneID";
-    static String PROPERTY_QUERY_TIMEOUT
-        = "javax.jdo.option.QueryTimeoutMillis";
+    static String PROPERTY_DATASTORE_READ_TIMEOUT_MILLIS
+        = "javax.jdo.option.DatastoreReadTimeoutMillis";
+    static String PROPERTY_DATASTORE_WRITE_TIMEOUT_MILLIS
+        = "javax.jdo.option.DatastoreWriteTimeoutMillis";
     static String NONCONFIGURABLE_PROPERTY_VENDOR_NAME
         = "VendorName";
     static String NONCONFIGURABLE_PROPERTY_VERSION_NUMBER

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/JDO_Test.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/JDO_Test.java?rev=916585&r1=916584&r2=916585&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/JDO_Test.java (original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/JDO_Test.java Fri Feb 26 06:32:05 2010
@@ -881,7 +881,7 @@
     /** Reports whether setting a Datastore timout is supported. */
     public boolean isDatastoreTimeoutSupported() {
         return supportedOptions.contains(
-            "javax.jdo.option.DatastoreTimeout");
+            Constants.OPTION_DATASTORE_TIMEOUT);
     }
 
     /** Reports whether a feature is supported */

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/api/persistencemanager/DatastoreTimeout.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/api/persistencemanager/DatastoreTimeout.java?rev=916585&r1=916584&r2=916585&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/api/persistencemanager/DatastoreTimeout.java
(original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/api/persistencemanager/DatastoreTimeout.java
Fri Feb 26 06:32:05 2010
@@ -95,8 +95,8 @@
         Thread t = new Thread(group, runnable, "Parallel Writer");
         t.start();
 
-        // Wait for a second such that the other thread can lock the instancs
-        Thread.currentThread().sleep(MAIN_SLEEP_MILLIS);
+        // Wait for a second such that the other thread can lock the instances
+        Thread.sleep(MAIN_SLEEP_MILLIS);
         
         try {
             runQueryReadingPCPointInstances(READ_TIMEOUT);
@@ -125,8 +125,8 @@
         Thread t = new Thread(group, runnable, "Parallel Reader");
         t.start();
 
-        // Wait for a second such that the other thread can lock the instancs
-        Thread.currentThread().sleep(MAIN_SLEEP_MILLIS);
+        // Wait for a second such that the other thread can lock the instances
+        Thread.sleep(MAIN_SLEEP_MILLIS);
 
         try {
             runUpdatePCointInstance(WRITE_TIMEOUT);
@@ -155,8 +155,8 @@
         Thread t = new Thread(group, runnable, "Parallel Writer");
         t.start();
 
-        // Wait for a second such that the other thread can lock the instancs
-        Thread.currentThread().sleep(MAIN_SLEEP_MILLIS);
+        // Wait for a second such that the other thread can lock the instances
+        Thread.sleep(MAIN_SLEEP_MILLIS);
 
         try {
             runQueryReadingPCPointInstances(ZERO_TIMEOUT);
@@ -183,8 +183,8 @@
         Thread t = new Thread(group, runnable, "Parallel Reader");
         t.start();
 
-        // Wait for a second such that the other thread can lock the instancs
-        Thread.currentThread().sleep(MAIN_SLEEP_MILLIS);
+        // Wait for a second such that the other thread can lock the instances
+        Thread.sleep(MAIN_SLEEP_MILLIS);
 
         try {
             runUpdatePCointInstance(ZERO_TIMEOUT);
@@ -236,7 +236,8 @@
             pm.currentTransaction().begin();
             Query q = pm.newQuery(PCPoint.class);
             q.setDatastoreReadTimeoutMillis(timeout);
-            List result = (List)q.execute();
+            @SuppressWarnings("unused")
+            List<?> result = (List<?>)q.execute();
             pm.currentTransaction().commit();
             if (!isDatastoreTimeoutSupported()) {
                 fail(ASSERTION_FAILED, "Query.setDatastoreReadTimeoutMillis should throw
a " +
@@ -269,6 +270,7 @@
         try {
             pm.currentTransaction().begin();
             pm.setDatastoreReadTimeoutMillis(timeout);
+            @SuppressWarnings("unused")
             PCPoint point1 = (PCPoint)pm.getObjectById(point1Oid, true);
             pm.currentTransaction().commit();
             if (!isDatastoreTimeoutSupported()) {
@@ -457,7 +459,7 @@
                 PCPoint p2 = (PCPoint)parallelPM.getObjectById(point2Oid, true);
                 p2.name();
                 // Give the main thread a chance to try to write the instances
-                Thread.currentThread().sleep(sleepMillis);
+                Thread.sleep(sleepMillis);
                 tx.commit();
             }
             catch (InterruptedException ex) {
@@ -494,7 +496,7 @@
                 // Flush will set a write lock on the instances
                 parallelPM.flush();
                 // Give the main thread a chance to try to read the instances
-                Thread.currentThread().sleep(sleepMillis);
+                Thread.sleep(sleepMillis);
                 tx.commit();
             } 
             catch (InterruptedException ex) {



Mime
View raw message