db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an...@apache.org
Subject svn commit: r698283 - in /db/jdo/trunk/api2-legacy/src/java/javax/jdo: Constants.java PersistenceManagerFactory.java Transaction.java
Date Tue, 23 Sep 2008 18:53:42 GMT
Author: andyj
Date: Tue Sep 23 11:53:42 2008
New Revision: 698283

URL: http://svn.apache.org/viewvc?rev=698283&view=rev
Log:
[JDO-590] Applied changes for transaction isolation level API

Modified:
    db/jdo/trunk/api2-legacy/src/java/javax/jdo/Constants.java
    db/jdo/trunk/api2-legacy/src/java/javax/jdo/PersistenceManagerFactory.java
    db/jdo/trunk/api2-legacy/src/java/javax/jdo/Transaction.java

Modified: db/jdo/trunk/api2-legacy/src/java/javax/jdo/Constants.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2-legacy/src/java/javax/jdo/Constants.java?rev=698283&r1=698282&r2=698283&view=diff
==============================================================================
--- db/jdo/trunk/api2-legacy/src/java/javax/jdo/Constants.java (original)
+++ db/jdo/trunk/api2-legacy/src/java/javax/jdo/Constants.java Tue Sep 23 11:53:42 2008
@@ -861,5 +861,49 @@
      */
     static String ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME
         = "";
-}
 
+    /**
+     * Transaction isolation level representing the ability to read
+     * uncommitted data.
+     * @see PersistenceManagerFactory#getTransactionIsolationLevel()
+     * @see Transaction#getIsolationLevel()
+     * @since 2.2
+     */
+    public static final String TX_READ_UNCOMMITTED = "read-uncommitted"; 
+
+    /**
+     * Transaction isolation level representing the requirement to read
+     * committed data only.
+     * @see PersistenceManagerFactory#getTransactionIsolationLevel()
+     * @see Transaction#getIsolationLevel()
+     * @since 2.2
+     */
+    public static final String TX_READ_COMMITTED = "read-committed"; 
+
+    /**
+     * Transaction isolation level representing the requirement to read
+     * the same data in the same transaction.
+     * @see PersistenceManagerFactory#getTransactionIsolationLevel()
+     * @see Transaction#getIsolationLevel()
+     * @since 2.2
+     */
+    public static final String TX_REPEATABLE_READ = "repeatable-read"; 
+
+    /**
+     * Transaction isolation level representing the requirement to keep
+     * a snapshot for reading data.
+     * @see PersistenceManagerFactory#getTransactionIsolationLevel()
+     * @see Transaction#getIsolationLevel()
+     * @since 2.2
+     */
+    public static final String TX_SNAPSHOT = "snapshot"; 
+
+    /**
+     * Transaction isolation level representing the requirement to serialize
+     * transactions.
+     * @see PersistenceManagerFactory#getTransactionIsolationLevel()
+     * @see Transaction#getIsolationLevel()
+     * @since 2.2
+     */
+    public static final String TX_SERIALIZABLE = "serializable"; 
+}

Modified: db/jdo/trunk/api2-legacy/src/java/javax/jdo/PersistenceManagerFactory.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2-legacy/src/java/javax/jdo/PersistenceManagerFactory.java?rev=698283&r1=698282&r2=698283&view=diff
==============================================================================
--- db/jdo/trunk/api2-legacy/src/java/javax/jdo/PersistenceManagerFactory.java (original)
+++ db/jdo/trunk/api2-legacy/src/java/javax/jdo/PersistenceManagerFactory.java Tue Sep 23
11:53:42 2008
@@ -488,6 +488,37 @@
      */
     void setReadOnly(boolean flag);
 
+    /** Get the value for transaction isolation level for this PMF.
+     * @return the transaction isolation level
+     * @see #setTransactionIsolationLevel(String)
+     * @since 2.2
+     */
+    String getTransactionIsolationLevel();
+
+    /** Set the value for transaction isolation level for this PMF.
+     * Transaction isolation levels are defined in javax.jdo.Constants.
+     * If the requested level is not available, but a higher level is
+     * available, the higher level is silently used. 
+     * If the requested level is not available, and no higher level is
+     * available, then JDOUnsupportedOptionException is thrown.
+     * Standard values in order from low to high are:
+     * <ul><li>read-uncommitted
+     * </li><li>read-committed
+     * </li><li>repeatable-read
+     * </li><li>snapshot
+     * </li><li>serializable
+     * </li></ul>
+     * @param level the transaction isolation level
+     * @see #getTransactionIsolationLevel()
+     * @see Constants#TX_READ_UNCOMMITTED
+     * @see Constants#TX_READ_COMMITTED
+     * @see Constants#TX_REPEATABLE_READ
+     * @see Constants#TX_SNAPSHOT
+     * @see Constants#TX_SERIALIZABLE
+     * @since 2.2
+     */
+    void setTransactionIsolationLevel(String level);
+
     /** Return non-configurable properties of this 
      * <code>PersistenceManagerFactory</code>.
      * Properties with keys <code>VendorName</code> and 
@@ -510,7 +541,7 @@
      * <BR>javax.jdo.option.Optimistic
      * <BR>javax.jdo.option.ApplicationIdentity
      * <BR>javax.jdo.option.DatastoreIdentity
-     * <BR>javax.jdo.option.NonDatastoreIdentity
+     * <BR>javax.jdo.option.NonDurableIdentity
      * <BR>javax.jdo.option.ArrayList
      * <BR>javax.jdo.option.HashMap
      * <BR>javax.jdo.option.Hashtable
@@ -526,6 +557,11 @@
      * <BR>javax.jdo.option.BinaryCompatibility
      * <BR>javax.jdo.option.GetDataStoreConnection
      * <BR>javax.jdo.option.UnconstrainedQueryVariables
+     * <BR>javax.jdo.option.TransactionIsolationLevel.read-uncommitted
+     * <BR>javax.jdo.option.TransactionIsolationLevel.read-committed
+     * <BR>javax.jdo.option.TransactionIsolationLevel.repeatable-read
+     * <BR>javax.jdo.option.TransactionIsolationLevel.snapshot
+     * <BR>javax.jdo.option.TransactionIsolationLevel.serializable
      * <BR>javax.jdo.query.SQL
      * <BR>javax.jdo.query.JDOQL
      * </code>

Modified: db/jdo/trunk/api2-legacy/src/java/javax/jdo/Transaction.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2-legacy/src/java/javax/jdo/Transaction.java?rev=698283&r1=698282&r2=698283&view=diff
==============================================================================
--- db/jdo/trunk/api2-legacy/src/java/javax/jdo/Transaction.java (original)
+++ db/jdo/trunk/api2-legacy/src/java/javax/jdo/Transaction.java Tue Sep 23 11:53:42 2008
@@ -165,7 +165,40 @@
      * @return the value of the Optimistic property.
      */
     boolean getOptimistic();
-    
+
+    /** Get the value for transaction isolation level for this transaction.
+     * @return the transaction isolation level
+     * @see #setIsolationLevel(String)
+     * @since 2.2
+     */
+    String getIsolationLevel();
+
+    /** Set the value for transaction isolation level for this transaction.
+     * Transaction isolation levels are defined in javax.jdo.Constants.
+     * If the requested level is not available, but a higher level is
+     * available, the higher level is silently used. 
+     * If the requested level is not available, and no higher level is
+     * available, then JDOUnsupportedOptionException is thrown.
+     * Five standard isolation levels are defined. Other isolation levels
+     * might be supported by an implementation but are not standard.
+     * <p>Standard values in order of low to high are:
+     * <ul><li>read-uncommitted
+     * </li><li>read-committed
+     * </li><li>repeatable-read
+     * </li><li>snapshot
+     * </li><li>serializable
+     * </li></ul>
+     * @param level the transaction isolation level
+     * @see #getIsolationLevel()
+     * @see Constants#TX_READ_UNCOMMITTED
+     * @see Constants#TX_READ_COMMITTED
+     * @see Constants#TX_REPEATABLE_READ
+     * @see Constants#TX_SNAPSHOT
+     * @see Constants#TX_SERIALIZABLE
+     * @since 2.2
+     */
+    void setIsolationLevel(String level);
+
     /** The user can specify a <code>Synchronization</code> instance to be 
      * notified on transaction completions.  The <code>beforeCompletion</code>

      * method is called prior to flushing instances to the data store.



Mime
View raw message