db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r892317 - in /db/jdo/trunk/api2/src/java/javax/jdo: Constants.java JDOQueryTimeoutException.java PersistenceManager.java PersistenceManagerFactory.java Query.java
Date Fri, 18 Dec 2009 17:03:47 GMT
Author: clr
Date: Fri Dec 18 17:03:47 2009
New Revision: 892317

URL: http://svn.apache.org/viewvc?rev=892317&view=rev
Log:
JDO-623 Change QueryTImeout to DatastoreTimeout

Removed:
    db/jdo/trunk/api2/src/java/javax/jdo/JDOQueryTimeoutException.java
Modified:
    db/jdo/trunk/api2/src/java/javax/jdo/Constants.java
    db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManager.java
    db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManagerFactory.java
    db/jdo/trunk/api2/src/java/javax/jdo/Query.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=892317&r1=892316&r2=892317&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/Constants.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/Constants.java Fri Dec 18 17:03:47 2009
@@ -475,6 +475,14 @@
     static String OPTION_QUERY_SQL
         = "javax.jdo.query.SQL";
     /**
+     * "javax.jdo.option.DatastoreTimeout"
+     *
+     * @see PersistenceManagerFactory#supportedOptions()
+     * @since 2.3
+     */
+    static String OPTION_DATASTORE_TIMEOUT
+        = "javax.jdo.option.DatastoreTimeout";
+    /**
      * "javax.jdo.option.UnconstrainedQueryVariables"
      *
      * @see PersistenceManagerFactory#supportedOptions()

Modified: db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManager.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManager.java?rev=892317&r1=892316&r2=892317&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManager.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManager.java Fri Dec 18 17:03:47 2009
@@ -953,21 +953,74 @@
      */
    boolean getIgnoreCache();
    
-    /** Set the default query timeout setting for all <code>Query</code>
-     * instances obtained from this PersistenceManager.
-     *
-     * @param interval The default timeout setting (millisecs).
-     * @since 2.3
-     */
-    void setQueryTimeoutMillis(Integer interval);
-
-    /** Get the default query timeout setting for all 
-     * <code>Query</code> instances obtained from this PersistenceManager.
-     *
-     * @return the default query timeout setting.
-     * @since 2.3
-     */
-    Integer getQueryTimeoutMillis();
+   /**
+    * Specify a timeout interval (milliseconds) for any datastore read
+    * operations associated with this persistence manager. To unset
+    * the explicit timeout, specify null. For no timeout, specify 0.
+    * Read operations include, for example, those associated with query,
+    * getObjectById, refresh, retrieve, and extent iteration operations.
+    * If the datastore granularity is larger than milliseconds, the
+    * timeout value will be rounded up to the nearest supported datastore
+    * value.
+    * If a read operation hasn't completed within this interval, the operation
+    * will throw a JDODatastoreException. 
+    * If multiple datastore operations are required to complete the query,
+    * the timeout value applies to each of them individually.
+    * If the datastore and JDO implementation support timeouts, then
+    * javax.jdo.option.DatastoreTimeout is returned by
+    * PersistenceManagerFactory.supportedOptions().
+    * If timeouts are not supported,this method will throw
+    * JDOUnsupportedOptionException.
+    * @since 2.3
+    * @param interval the timeout interval (milliseconds)
+    */
+   void setDatastoreReadTimeoutMillis(Integer interval);
+
+   /** Get the effective timeout setting for datastore read operations
+    * associated with this persistence manager.
+    * If the timeout has not been set on this persistence manager explicitly,
+    * the default read timeout value from the persistence manager factory
+    * is returned.
+    * @see #setDatastoreReadTimeoutMillis(Integer)
+    * @see PersistenceManagerFactory#setDatastoreReadTimeoutMillis(Integer)
+    * @return the effective timeout setting (milliseconds).
+    * @since 2.3
+    */
+   Integer getDatastoreReadTimeoutMillis();
+
+   /**
+    * Specify a timeout interval (milliseconds) for any write operations
+    * associated with this persistence manager. To unset the explicit timeout,
+    * specify null. For no timeout, specify 0.
+    * Datastore write operations include, for example, operations associated
+    * with flush, commit, and delete by query.
+    * If the datastore granularity is larger than milliseconds, the
+    * timeout value will be rounded up to the nearest supported datastore
+    * value.
+    * If a write operation hasn't completed within this interval, methods
+    * will throw a JDODatastoreException. 
+    * If multiple datastore operations are required to complete the method,
+    * the timeout value applies to each of them individually.
+    * If the datastore and JDO implementation support timeouts, then
+    * javax.jdo.option.DatastoreTimeout is returned by
+    * PersistenceManagerFactory.supportedOptions().
+    * If timeouts are not supported,this method will throw
+    * JDOUnsupportedOptionException.
+    * @since 2.3
+    * @param interval the timeout interval (milliseconds)
+    */
+   void setDatastoreWriteTimeoutMillis(Integer interval);
+
+   /** Get the effective timeout setting for write operations. 
+    * If the timeout has not been set on this persistence manager explicitly,
+    * the default datastore write timeout value from the persistence manager
+    * factory is returned.
+    * @see #setDatastoreWriteTimeoutMillis(Integer)
+    * @see PersistenceManagerFactory#setDatastoreWriteTimeoutMillis(Integer)
+    * @return the effective timeout setting (milliseconds).
+    * @since 2.3
+    */
+   Integer getDatastoreWriteTimeoutMillis();
 
    /** Gets the detachAllOnCommit setting.
     * @see #setDetachAllOnCommit(boolean)

Modified: db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManagerFactory.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManagerFactory.java?rev=892317&r1=892316&r2=892317&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManagerFactory.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/PersistenceManagerFactory.java Fri Dec 18 17:03:47
2009
@@ -520,21 +520,49 @@
      */
     void setTransactionIsolationLevel(String level);
 
-    /** Set the default query timeout setting for all <code>PersistenceManager</code>
-     * instances obtained from this factory.
-     *
-     * @param interval The default timeout setting (millisecs).
+    /**
+     * Specify a default timeout interval (milliseconds) for any read
+     * operations for persistence managers obtained from this persistence
+     * manager factory. To unset the explicit timeout, specify null.
+     * For no timeout, specify 0.
+     * If the datastore and JDO implementation support timeouts, then
+     * javax.jdo.option.DatastoreTimeout is returned by supportedOptions().
+     * If timeouts are not supported,this method will throw
+     * JDOUnsupportedOptionException.
      * @since 2.3
+     * @param interval the timeout interval (milliseconds)
      */
-    void setQueryTimeoutMillis(Integer interval);
+    void setDatastoreReadTimeoutMillis(Integer interval);
 
-    /** Get the default query timeout setting for all 
-     * <code>PersistenceManager</code> instances obtained from this factory.
-     *
-     * @return the default query timeout setting.
+    /** Get the default timeout setting for read operations.
+     * If timeouts are not supported,this method will return null.
+     * @see #setDatastoreReadTimeoutMillis(Integer)
+     * @return the default timeout setting (milliseconds).
+     * @since 2.3
+     */
+    Integer getDatastoreReadTimeoutMillis();
+
+    /**
+     * Specify a default timeout interval (milliseconds) for any write
+     * operations for persistence managers obtained from this persistence
+     * manager factory. To unset the explicit timeout, specify null.
+     * For no timeout, specify 0.
+     * If the datastore and JDO implementation support timeouts, then
+     * javax.jdo.option.DatastoreTimeout is returned by supportedOptions().
+     * If timeouts are not supported,this method will throw
+     * JDOUnsupportedOptionException.
+     * @since 2.3
+     * @param interval the timeout interval (milliseconds)
+     */
+    void setDatastoreWriteTimeoutMillis(Integer interval);
+
+    /** Get the default timeout setting for write operations.
+     * If timeouts are not supported,this method will return null.
+     * @see #setDatastoreWriteTimeoutMillis(Integer)
+     * @return the default timeout setting (milliseconds).
      * @since 2.3
      */
-    Integer getQueryTimeoutMillis();
+    Integer getDatastoreWriteTimeoutMillis();
 
     /** Return non-configurable properties of this 
      * <code>PersistenceManagerFactory</code>.
@@ -580,6 +608,7 @@
      * <BR>javax.jdo.option.TransactionIsolationLevel.snapshot
      * <BR>javax.jdo.option.TransactionIsolationLevel.serializable
      * <BR>javax.jdo.option.QueryCancel
+     * <BR>javax.jdo.option.DatastoreTimeout
      * <BR>javax.jdo.query.SQL
      * <BR>javax.jdo.query.JDOQL
      * </code>

Modified: db/jdo/trunk/api2/src/java/javax/jdo/Query.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/Query.java?rev=892317&r1=892316&r2=892317&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/Query.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/Query.java Fri Dec 18 17:03:47 2009
@@ -698,20 +698,66 @@
          String candidateCollectionExpression, Map parameters);
 
     /**
-     * Specify a timeout interval (milliseconds) for any query executions.
-     * If a query hasn't completed within this interval execute() will throw a
-     * JDOQueryTimeoutException.
+     * Specify a timeout interval (milliseconds) for any read operations
+     * associated with this query. To unset the explicit timeout for this
+     * query, specify null. For no timeout, specify 0.
+     * If the datastore granularity is larger than milliseconds, the
+     * timeout value will be rounded up to the nearest supported datastore
+     * value.
+     * If a read operation hasn't completed within this interval, executeXXX
+     * will throw a JDODatastoreException. 
+     * If multiple datastore operations are required to complete the query,
+     * the timeout value applies to each of them individually.
+     * If the datastore and JDO implementation support timeouts, then
+     * javax.jdo.option.DatastoreTimeout is returned by
+     * PersistenceManagerFactory.supportedOptions().
+     * If timeouts are not supported,this method will throw
+     * JDOUnsupportedOptionException.
+     * @since 2.3
+     * @param interval the timeout interval (milliseconds)
+     */
+    void setDatastoreReadTimeoutMillis(Integer interval);
+
+    /** Get the effective timeout setting for read operations.
+     * If the timeout has not been set on this query explicitly, the effective
+     * datastore read timeout value from the persistence manager is returned.
+     * @see #setDatastoreReadTimeoutMillis(Integer)
+     * @see PersistenceManager#setDatastoreReadTimeoutMillis(Integer)
+     * @return the effective timeout setting (milliseconds).
      * @since 2.3
-     * @param interval The timeout interval (millisecs)
      */
-    void setTimeoutMillis(Integer interval);
+    Integer getDatastoreReadTimeoutMillis();
 
-    /** Get the timeout setting for query executions. 
-     *
-     * @return the query timeout setting.
+    /**
+     * Specify a timeout interval (milliseconds) for any write operations
+     * associated with this query. To unset the explicit timeout for this
+     * query, specify null. For no timeout, specify 0.
+     * If the datastore granularity is larger than milliseconds, the
+     * timeout value will be rounded up to the nearest supported datastore
+     * value.
+     * If a write operation hasn't completed within this interval, deleteXXX
+     * will throw a JDODatastoreException. 
+     * If multiple datastore operations are required to complete the query,
+     * the timeout value applies to each of them individually.
+     * If the datastore and JDO implementation support timeouts, then
+     * javax.jdo.option.DatastoreTimeout is returned by
+     * PersistenceManagerFactory.supportedOptions().
+     * If timeouts are not supported,this method will throw
+     * JDOUnsupportedOptionException.
+     * @since 2.3
+     * @param interval the timeout interval (milliseconds)
+     */
+    void setDatastoreWriteTimeoutMillis(Integer interval);
+
+    /** Get the effective timeout setting for write operations. 
+     * If the timeout has not been set on this query explicitly, the effective
+     * datastore write timeout value from the persistence manager is returned.
+     * @see #setDatastoreWriteTimeoutMillis(Integer)
+     * @see PersistenceManager#setDatastoreWriteTimeoutMillis(Integer)
+     * @return the effective timeout setting (milliseconds).
      * @since 2.3
      */
-    Integer getTimeoutMillis();
+    Integer getDatastoreWriteTimeoutMillis();
 
     /**
      * Method to cancel any executing queries.



Mime
View raw message