openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r884744 [1/2] - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ openjpa-jdbc/src/main/jav...
Date Fri, 27 Nov 2009 05:11:23 GMT
Author: allee8285
Date: Fri Nov 27 05:11:21 2009
New Revision: 884744

URL: http://svn.apache.org/viewvc?rev=884744&view=rev
Log:
OPENJPA-1402 - Improve concurrency by not locking relation field whenever appropriate for mixed lock manager.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCLockManager.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/MixedLockManager.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/VersionStrategy.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MergedResult.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Result.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractLockManager.java
    openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/LockScopeTestCase.java
    openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/Test1x1LockScope.java
    openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/SequencedActionsTest.java
    openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerDeadlock.java
    openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerFindPermutation.java
    openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerLockPermutation.java
    openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerRefreshPermutation.java
    openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestPessimisticLocks.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCLockManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCLockManager.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCLockManager.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCLockManager.java Fri Nov 27 05:11:21 2009
@@ -46,4 +46,9 @@
      * produced by a FOR UPDATE select.
      */
     public void loadedForUpdate(OpenJPAStateManager sm);
+
+    /**
+     * Return true if locking is not desired for relation fields.
+     */
+    public boolean skipRelationFieldLock();
 }

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/MixedLockManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/MixedLockManager.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/MixedLockManager.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/MixedLockManager.java Fri Nov 27 05:11:21 2009
@@ -128,4 +128,8 @@
             }
         }
     }
+
+    public boolean skipRelationFieldLock() {
+        return true;
+    }
 }

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/VersionStrategy.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/VersionStrategy.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/VersionStrategy.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/VersionStrategy.java Fri Nov 27 05:11:21 2009
@@ -24,7 +24,6 @@
 import org.apache.openjpa.jdbc.kernel.JDBCStore;
 import org.apache.openjpa.jdbc.sql.Result;
 import org.apache.openjpa.jdbc.sql.Select;
-import org.apache.openjpa.jdbc.schema.Column;
 import org.apache.openjpa.kernel.OpenJPAStateManager;
 import org.apache.openjpa.kernel.StoreManager;
 

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java Fri Nov 27 05:11:21 2009
@@ -23,6 +23,7 @@
 import java.sql.SQLException;
 import java.util.Comparator;
 
+import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
 import org.apache.openjpa.jdbc.kernel.JDBCStore;
 import org.apache.openjpa.jdbc.meta.ClassMapping;
 import org.apache.openjpa.jdbc.meta.VersionMappingInfo;
@@ -34,6 +35,7 @@
 import org.apache.openjpa.jdbc.sql.Row;
 import org.apache.openjpa.jdbc.sql.RowManager;
 import org.apache.openjpa.jdbc.sql.Select;
+import org.apache.openjpa.kernel.MixedLockLevels;
 import org.apache.openjpa.kernel.OpenJPAStateManager;
 import org.apache.openjpa.kernel.StoreManager;
 import org.apache.openjpa.lib.util.Localizer;
@@ -277,7 +279,13 @@
         sel.select(cols);
         sel.wherePrimaryKey(sm.getObjectId(), vers.getClassMapping(), store);
 
-        Result res = sel.execute(store, null);
+        // No need to lock version field (i.e. optimistic), except when version update is required (e.g. refresh) 
+        JDBCFetchConfiguration fetch = store.getFetchConfiguration();
+        if (!updateVersion && fetch.getReadLockLevel() >= MixedLockLevels.LOCK_PESSIMISTIC_READ) {
+            fetch = (JDBCFetchConfiguration) fetch.clone();
+            fetch.setReadLockLevel(MixedLockLevels.LOCK_NONE);
+        }
+        Result res = sel.execute(store, fetch);
         try {
             if (!res.next())
                 return false;

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java Fri Nov 27 05:11:21 2009
@@ -30,6 +30,7 @@
 import org.apache.openjpa.enhance.ReflectingPersistenceCapable;
 import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
 import org.apache.openjpa.jdbc.kernel.JDBCStore;
+import org.apache.openjpa.jdbc.kernel.MixedLockManager;
 import org.apache.openjpa.jdbc.meta.ClassMapping;
 import org.apache.openjpa.jdbc.meta.Embeddable;
 import org.apache.openjpa.jdbc.meta.FieldMapping;
@@ -53,6 +54,7 @@
 import org.apache.openjpa.jdbc.sql.Select;
 import org.apache.openjpa.jdbc.sql.SelectExecutor;
 import org.apache.openjpa.jdbc.sql.Union;
+import org.apache.openjpa.kernel.LockManager;
 import org.apache.openjpa.kernel.OpenJPAStateManager;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.util.Localizer;
@@ -65,6 +67,7 @@
 import org.apache.openjpa.util.MetaDataException;
 import org.apache.openjpa.util.OpenJPAId;
 import org.apache.openjpa.util.UnsupportedException;
+
 import serp.util.Numbers;
 
 /**
@@ -699,8 +702,14 @@
         	}
         }
 
-        sm.storeObject(field.getIndex(), res.load(cls, store, fetch,
-            eagerJoin(res.newJoins(), cls, false)));
+        boolean isLocked = res.isLocking();
+        try {
+            res.setLocking(store.getLockManager().skipRelationFieldLock());
+            sm.storeObject(field.getIndex(), res.load(cls, store, fetch,
+                    eagerJoin(res.newJoins(), cls, false)));
+        } finally {
+            res.setLocking(isLocked);
+        }
 
         // reset mapped by is needed for OneToOne bidirectional relations
         // having a mapped-by parent to correctly set the parent-child

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MergedResult.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MergedResult.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MergedResult.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MergedResult.java Fri Nov 27 05:11:21 2009
@@ -97,6 +97,10 @@
             _res[i].close();
     }
 
+    public void setLocking(boolean locking) {
+        _res[_idx].setLocking(locking);
+    }
+
     public boolean isLocking() {
         return _res[_idx].isLocking();
     }

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Result.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Result.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Result.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Result.java Fri Nov 27 05:11:21 2009
@@ -79,6 +79,11 @@
     public void close();
 
     /**
+     * Set to true if row locking has been issued for the row.  
+     */
+    public void setLocking(boolean locking);
+
+    /**
      * If true, then any results loaded from this Result
      * will be locked in the database.
      */

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractLockManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractLockManager.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractLockManager.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractLockManager.java Fri Nov 27 05:11:21 2009
@@ -57,7 +57,7 @@
      */
     public void lockAll(Collection sms, int level, int timeout,
         Object context) {
-        for (Iterator itr = sms.iterator(); itr.hasNext();)
+        for (Iterator<?> itr = sms.iterator(); itr.hasNext();)
             lock((OpenJPAStateManager) itr.next(), level, timeout, context);
     }
 
@@ -76,8 +76,14 @@
     /**
      * Does nothing by default.
      */
-    public void close ()
-	{
+    public void close () {
 	}
+
+    /**
+     * Default not to skip relation field to maintain PessimisticLockManager semantics. 
+     */
+    public boolean skipRelationFieldLock() {
+        return false;
+    }
 }
 

Modified: openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/LockScopeTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/LockScopeTestCase.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/LockScopeTestCase.java (original)
+++ openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/LockScopeTestCase.java Fri Nov 27 05:11:21 2009
@@ -68,6 +68,7 @@
     
     protected final String Any              = ".*";
     protected final String Select           = "SELECT.*FROM.*";
+    protected final String SelectVersion    = "SELECT.*version.*FROM.*";
     protected final String Where            = ".*WHERE.*";
 //    protected final String Join             = ".*(JOIN){1}.*";
     protected final String NoJoin           = "(JOIN){0}";
@@ -155,6 +156,15 @@
         assertAllSQLAnyOrder(expected);
     }
     
+    public void assertLockTestNoSQLs(String... expected) {
+        Log log = getDumpSQLLog(); 
+        if( log.isTraceEnabled()) {
+            log.trace("\r\n" + toString(sql));
+            return;
+        }
+        assertNoneSQLAnyOrder(expected);
+    }
+
     protected void logStack(Throwable t) {
         StringWriter str = new StringWriter();
         PrintWriter print = new PrintWriter(str);

Modified: openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/Test1x1LockScope.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/Test1x1LockScope.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/Test1x1LockScope.java (original)
+++ openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lock/extended/Test1x1LockScope.java Fri Nov 27 05:11:21 2009
@@ -43,8 +43,8 @@
             , LSE1x1LfJT.class
             , LSE1x1LfJTLzy.class
             , LSE1x1Rt.class
-            , "openjpa.LockManager", "mixed",
-            "openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)"
+            , "openjpa.LockManager", "mixed"
+            , "openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)"
         );
         commonSetUp(LSE1x1Lf.class
                 , LSE1x1LfLzy.class
@@ -138,12 +138,18 @@
                         case db2:
                             // SELECT t0.version, t0.firstName, t1.id, t1.version, t1.lastName FROM LSE1x1Lf t0
                             //      LEFT OUTER JOIN LSE1x1Rt t1 ON t0.UNIRIGHT_ID = t1.id WHERE t0.id = ?
-                            //      optimize for 1 row FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS [params=(int) 1111202]
+                            //      optimize for 1 row FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS
+                            //      [params=(int) 1111202]
                             // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ?
-                            //      FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS [params=(int) 1121202]                                                                                                                                 
+                            //      -FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS- [params=(int) 1121202]                                                                                                                                 
                             // SELECT t0.version FROM LSE1x1Lf t0 WHERE t0.id = ?
-                            //      FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS [params=(int) 1111202]
-                            assertLockTestSQLs(Select + joinTables + Where + DB2Lock);
+                            //      -FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS- [params=(int) 1111202]
+                            assertLockTestSQLs(Select + joinTables + Where + DB2Lock,
+                                    SelectVersion + NoJoin + Any + tableLfName + Any + NoJoin + Where + NoForUpdate,
+                                    SelectVersion + NoJoin + Any + tableRtName + Any + NoJoin + Where + NoForUpdate
+                                    );
+                            assertLockTestNoSQLs(Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
+                                    );
                             break;
                         case oracle:    // TODO: if jpa2, DO NOT lock LSE1x1RT using "FOR UPDATE OF col"
                             // SELECT t0.version, t0.firstName, t1.id, t1.version, t1.lastName 
@@ -154,20 +160,25 @@
                             assertLockTestSQLs(Select + tableLfName + Any + tableRtName + Where + "\\(\\+\\).*"
                                     + ForUpdate);
                             break;
-                        case derby:     //TODO: **Non-atomic lock.
+                        case derby:     //-TODO: **Non-atomic lock.
                             // The database is unable to lock this query.  Each object matching the query will be 
                             //  locked individually after it is loaded; however, it is technically possible that
                             //  another transaction could modify the data before the lock is obtained.
                             // SELECT t0.version, t0.firstName, t1.id, t1.version, t1.lastName FROM LSE1x1Lf t0
                             //      LEFT OUTER JOIN LSE1x1Rt t1 ON t0.UNIRIGHT_ID = t1.id WHERE t0.id = ?
                             //      [params=(int) 1111202]
-                            // SELECT t0.id FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1121202]
-                            // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1121202]
+                            // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ? -FOR UPDATE WITH RR-
+                            //      [params=(int) 1121202]
                             // SELECT t0.id FROM LSE1x1Lf t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1111202]
-                            // SELECT t0.version FROM LSE1x1Lf t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1111202]
+                            // SELECT t0.version FROM LSE1x1Lf t0 WHERE t0.id = ? -FOR UPDATE WITH RR-
+                            //      [params=(int) 1111202]
                             assertLockTestSQLs(Select + joinTables + Where + NoForUpdate,
                                     Select + NoJoin + Any + tableLfName + Any + NoJoin + Where + ForUpdate,
-                                    Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
+                                    SelectVersion + NoJoin + Any + tableLfName + Any + NoJoin + Where + NoForUpdate,
+                                    SelectVersion + NoJoin + Any + tableRtName + Any + NoJoin + Where + NoForUpdate
+                                    );
+                            //-SELECT t0.id FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1121202]-
+                            assertLockTestNoSQLs(Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
                                     );
                             break;
                         default:
@@ -184,7 +195,12 @@
                             //      FOR READ ONLY WITH RS USE AND KEEP UPDATE LOCKS [params=(String) firstName%1111201]
                             // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ?  [params=(int) 1121201]
                             // SELECT t0.version FROM LSE1x1Lf t0 WHERE t0.id = ?  [params=(int) 1111201]
-                            assertLockTestSQLs(Select + joinTables + Where + DB2Lock);
+                            assertLockTestSQLs(Select + joinTables + Where + DB2Lock,
+                                    SelectVersion + NoJoin + Any + tableLfName + Any + NoJoin + Where + NoForUpdate,
+                                    SelectVersion + NoJoin + Any + tableRtName + Any + NoJoin + Where + NoForUpdate
+                                    );
+                            assertLockTestNoSQLs(Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
+                                    );
                             break;
                         case oracle:    // TODO: if jpa2, DO NOT lock LSE1x1RT using "FOR UPDATE OF col"
                             // SELECT t0.id, t0.version, t0.firstName, t1.id, t1.version, t1.lastName 
@@ -196,20 +212,23 @@
                             assertLockTestSQLs(Select + tableLfName + Any + tableRtName + Where + "\\(\\+\\).*"
                                     + ForUpdate);
                             break;
-                        case derby:     //TODO: **Non-atomic lock.
+                        case derby:     //-TODO: **Non-atomic lock.
                             // The database is unable to lock this query.  Each object matching the query will be 
                             //  locked individually after it is loaded; however, it is technically possible that
                             //  another transaction could modify the data before the lock is obtained.
-                            //SELECT t0.id, t0.version, t0.firstName, t1.id, t1.version, t1.lastName FROM LSE1x1Lf t0
+                            // SELECT t0.id, t0.version, t0.firstName, t1.id, t1.version, t1.lastName FROM LSE1x1Lf t0
                             //      LEFT OUTER JOIN LSE1x1Rt t1 ON t0.UNIRIGHT_ID = t1.id
                             //      WHERE (t0.firstName LIKE ? ESCAPE '\') [params=(String) firstName%1111201]
-                            // SELECT t0.id FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1121201]
                             // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ? [params=(int) 1121201]
                             // SELECT t0.id FROM LSE1x1Lf t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1111201]
                             // SELECT t0.version FROM LSE1x1Lf t0 WHERE t0.id = ? [params=(int) 1111201]
                             assertLockTestSQLs(Select + joinTables + Where + NoForUpdate,
                                     Select + NoJoin + Any + tableLfName + Any + NoJoin + Where + ForUpdate,
-                                    Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
+                                    SelectVersion + NoJoin + Any + tableLfName + Any + NoJoin + Where + NoForUpdate,
+                                    SelectVersion + NoJoin + Any + tableRtName + Any + NoJoin + Where + NoForUpdate
+                                    );
+                            //-SELECT t0.id FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1121201]-
+                            assertLockTestNoSQLs(Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
                                     );
                             break;
                         default:
@@ -250,7 +269,12 @@
                             //      FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS [params=(String) firstName%1111201]
                             // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ?  [params=(int) 1121201]
                             // SELECT t0.version FROM LSE1x1Lf t0 WHERE t0.id = ?  [params=(int) 1111201]
-                            assertLockTestSQLs(Select + joinTables + Where + DB2Lock);
+                            assertLockTestSQLs(Select + joinTables + Where + DB2Lock,
+                                    SelectVersion + NoJoin + Any + tableLfName + Any + NoJoin + Where + NoForUpdate,
+                                    SelectVersion + NoJoin + Any + tableRtName + Any + NoJoin + Where + NoForUpdate
+                                    );
+                            assertLockTestNoSQLs(Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
+                                    );
                             break;
                         case oracle:    // TODO: if jpa2, DO NOT lock LSE1x1RT using "FOR UPDATE OF col"
                             // SELECT t0.id, t0.version, t0.firstName, t1.id, t1.version, t1.lastName 
@@ -262,20 +286,23 @@
                             assertLockTestSQLs(Select + tableLfName + Any + tableRtName + Where + "\\(\\+\\).*"
                                     + ForUpdate);
                             break;
-                        case derby:     //TODO: **Non-atomic lock.
+                        case derby:     //-TODO: **Non-atomic lock.
                             // The database is unable to lock this query.  Each object matching the query will be 
                             //  locked individually after it is loaded; however, it is technically possible that
                             //  another transaction could modify the data before the lock is obtained.
                             // SELECT t0.id, t0.version, t0.firstName, t1.id, t1.version, t1.lastName FROM LSE1x1Lf t0
                             //      LEFT OUTER JOIN LSE1x1Rt t1 ON t0.UNIRIGHT_ID = t1.id
                             //      WHERE (t0.firstName LIKE ? ESCAPE '\') [params=(String) firstName%1111201]
-                            // SELECT t0.id FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1121201]
                             // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ? [params=(int) 1121201]
                             // SELECT t0.id FROM LSE1x1Lf t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1111201]
                             // SELECT t0.version FROM LSE1x1Lf t0 WHERE t0.id = ? [params=(int) 1111201]
                             assertLockTestSQLs(Select + joinTables + Where + NoForUpdate,
                                     Select + NoJoin + Any + tableLfName + Any + NoJoin + Where + ForUpdate,
-                                    Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
+                                    SelectVersion + NoJoin + Any + tableLfName + Any + NoJoin + Where + NoForUpdate,
+                                    SelectVersion + NoJoin + Any + tableRtName + Any + NoJoin + Where + NoForUpdate
+                                    );
+                            //-SELECT t0.id FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1121201]-
+                            assertLockTestNoSQLs(Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
                                     );
                             break;
                         default:
@@ -579,10 +606,18 @@
                             // SELECT t0.version, t0.firstName, t2.id, t2.version, t2.lastName FROM LSE1x1LfJT t0 
                             //      INNER JOIN Uni1x1LfJT_Uni1x1RT t1 ON t0.id = t1.LSE1X1LFJT_ID 
                             //      LEFT OUTER JOIN LSE1x1Rt t2 ON t1.UNIRIGHTJT_ID = t2.id WHERE t0.id = ?
-                            //      optimize for 1 row FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS [params=(int) 1112202]
-                            // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ?  FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS [params=(int) 1122202]
-                            // SELECT t0.version FROM LSE1x1LfJT t0 WHERE t0.id = ?  FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS [params=(int) 1112202]
-                            assertLockTestSQLs(Select + joinTables + Where + DB2Lock);
+                            //      optimize for 1 row FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS 
+                            //      [params=(int) 1112202]
+                            // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ? 
+                            //      FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS [params=(int) 1122202]
+                            // SELECT t0.version FROM LSE1x1LfJT t0 WHERE t0.id = ?
+                            //      FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS [params=(int) 1112202]
+                            assertLockTestSQLs(Select + joinTables + Where + DB2Lock,
+                                    SelectVersion + NoJoin + Any + tableLfName + Any + NoJoin + Where + NoForUpdate,
+                                    SelectVersion + NoJoin + Any + tableRtName + Any + NoJoin + Where + NoForUpdate
+                                    );
+                            assertLockTestNoSQLs(Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
+                                    );
                             break;
                         case oracle:    // TODO: If jpa2, DO NOT lock LSE1x1RT using "FOR UDPATE OF col"
                             // SELECT t0.version, t0.firstName, t2.id, t2.version, t2.lastName 
@@ -594,7 +629,7 @@
                             assertLockTestSQLs(Select + tableLfName + Any + tableJTName + Any + tableRtName + Where
                                     + "\\(\\+\\).*" + ForUpdate);
                             break;
-                        case derby:     //TODO: **Non-atomic lock, if jpa2/extended scope, LOCK Uni1x1LfJT_Uni1x1RT
+                        case derby:     //-TODO: **Non-atomic lock, if jpa2/extended scope, LOCK Uni1x1LfJT_Uni1x1RT
                                         // DO NOT lock LSE1x1Rt
                             // The database is unable to lock this query.  Each object matching the query will be 
                             //  locked individually after it is loaded; however, it is technically possible that
@@ -603,13 +638,18 @@
                             //      INNER JOIN Uni1x1LfJT_Uni1x1RT t1 ON t0.id = t1.LSE1X1LFJT_ID
                             //      LEFT OUTER JOIN LSE1x1Rt t2 ON t1.UNIRIGHTJT_ID = t2.id WHERE t0.id = ?
                             //      [params=(int) 1112202]
-                            // SELECT t0.id FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1122202]
-                            // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1122202]
+                            // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ? -FOR UPDATE WITH RR- 
+                            //      [params=(int) 1122202]
                             // SELECT t0.id FROM LSE1x1LfJT t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1112202]
-                            // SELECT t0.version FROM LSE1x1LfJT t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1112202]
+                            // SELECT t0.version FROM LSE1x1LfJT t0 WHERE t0.id = ? -FOR UPDATE WITH RR-
+                            //      [params=(int) 1112202]
                             assertLockTestSQLs(Select + joinTables + Where + NoForUpdate,
                                     Select + NoJoin + Any + tableLfName + Any + NoJoin + Where + ForUpdate,
-                                    Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
+                                    SelectVersion + NoJoin + Any + tableLfName + Any + NoJoin + Where + NoForUpdate,
+                                    SelectVersion + NoJoin + Any + tableRtName + Any + NoJoin + Where + NoForUpdate
+                                    );
+                            //-SELECT t0.id FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1122202]-
+                            assertLockTestNoSQLs(Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
                                     );
                             break;
                         default:
@@ -627,7 +667,12 @@
                             //      FOR READ ONLY WITH RS USE AND KEEP UPDATE LOCKS [params=(String) firstName%1112201]
                             // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ?  [params=(int) 1122201]
                             // SELECT t0.version FROM LSE1x1LfJT t0 WHERE t0.id = ?  [params=(int) 1112201]
-                            assertLockTestSQLs(Select + joinTables + Where + DB2Lock);
+                            assertLockTestSQLs(Select + joinTables + Where + DB2Lock,
+                                    SelectVersion + NoJoin + Any + tableLfName + Any + NoJoin + Where + NoForUpdate,
+                                    SelectVersion + NoJoin + Any + tableRtName + Any + NoJoin + Where + NoForUpdate
+                                    );
+                            assertLockTestNoSQLs(Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
+                                    );
                             break;
                         case oracle:    // TODO: If jpa2, DO NOT lock LSE1x1RT using "FOR UDPATE OF col"
                             // SELECT t0.id, t0.version, t0.firstName, t2.id, t2.version, t2.lastName 
@@ -639,7 +684,7 @@
                             assertLockTestSQLs(Select + tableLfName + Any + tableJTName + Any + tableRtName + Where
                                     + "\\(\\+\\).*" + ForUpdate);
                             break;
-                        case derby:     //TODO: **Non-atomic lock, if jpa2/extended scope, LOCK Uni1x1LfJT_Uni1x1RT
+                        case derby:     //-TODO: **Non-atomic lock, if jpa2/extended scope, LOCK Uni1x1LfJT_Uni1x1RT
                                         // DO NOT lock LSE1x1Rt
                             // The database is unable to lock this query.  Each object matching the query will be 
                             //  locked individually after it is loaded; however, it is technically possible that
@@ -648,13 +693,16 @@
                             //      INNER JOIN Uni1x1LfJT_Uni1x1RT t1 ON t0.id = t1.LSE1X1LFJT_ID 
                             //      LEFT OUTER JOIN LSE1x1Rt t2 ON t1.UNIRIGHTJT_ID = t2.id 
                             //      WHERE (t0.firstName LIKE ? ESCAPE '\') [params=(String) firstName%1112201]
-                            // SELECT t0.id FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1122201]
                             // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ? [params=(int) 1122201]
                             // SELECT t0.id FROM LSE1x1LfJT t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1112201]
                             // SELECT t0.version FROM LSE1x1LfJT t0 WHERE t0.id = ? [params=(int) 1112201]
                             assertLockTestSQLs(Select + joinTables + Where + NoForUpdate,
                                     Select + NoJoin + Any + tableLfName + Any + NoJoin + Where + ForUpdate,
-                                    Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
+                                    SelectVersion + NoJoin + Any + tableLfName + Any + NoJoin + Where + NoForUpdate,
+                                    SelectVersion + NoJoin + Any + tableRtName + Any + NoJoin + Where + NoForUpdate
+                                    );
+                            //-SELECT t0.id FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1122201]-
+                            assertLockTestNoSQLs(Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
                                     );
                             break;
                         default:
@@ -699,7 +747,12 @@
                             //      FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS [params=(String) firstName%1112201]
                             // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ?  [params=(int) 1122201]
                             // SELECT t0.version FROM LSE1x1LfJT t0 WHERE t0.id = ?  [params=(int) 1112201]
-                            assertLockTestSQLs(Select + joinTables + Where + DB2Lock);
+                            assertLockTestSQLs(Select + joinTables + Where + DB2Lock,
+                                    SelectVersion + NoJoin + Any + tableLfName + Any + NoJoin + Where + NoForUpdate,
+                                    SelectVersion + NoJoin + Any + tableRtName + Any + NoJoin + Where + NoForUpdate
+                                    );
+                            assertLockTestNoSQLs(Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
+                                    );
                             break;
                         case oracle:    // TODO: If jpa2, DO NOT lock LSE1x1RT using "FOR UDPATE OF col"
                             // SELECT t0.id, t0.version, t0.firstName, t2.id, t2.version, t2.lastName 
@@ -711,7 +764,7 @@
                             assertLockTestSQLs(Select + tableLfName + Any + tableJTName + Any + tableRtName + Where
                                     + "\\(\\+\\).*" + ForUpdate);
                             break;
-                        case derby:     //TODO: **Non-atomic lock, if jpa2/extended scope, LOCK Uni1x1LfJT_Uni1x1RT
+                        case derby:     //-TODO: **Non-atomic lock, if jpa2/extended scope, LOCK Uni1x1LfJT_Uni1x1RT
                                         // DO NOT lock LSE1x1Rt
                             // The database is unable to lock this query.  Each object matching the query will be 
                             //  locked individually after it is loaded; however, it is technically possible that
@@ -720,13 +773,16 @@
                             //      INNER JOIN Uni1x1LfJT_Uni1x1RT t1 ON t0.id = t1.LSE1X1LFJT_ID
                             //      LEFT OUTER JOIN LSE1x1Rt t2 ON t1.UNIRIGHTJT_ID = t2.id
                             //      WHERE (t0.firstName LIKE ? ESCAPE '\') [params=(String) firstName%1112201]
-                            // SELECT t0.id FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1122201]
                             // SELECT t0.version FROM LSE1x1Rt t0 WHERE t0.id = ? [params=(int) 1122201]
                             // SELECT t0.id FROM LSE1x1LfJT t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1112201]
                             // SELECT t0.version FROM LSE1x1LfJT t0 WHERE t0.id = ? [params=(int) 1112201]
                             assertLockTestSQLs(Select + joinTables + Where + NoForUpdate,
                                     Select + NoJoin + Any + tableLfName + Any + NoJoin + Where + ForUpdate,
-                                    Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
+                                    SelectVersion + NoJoin + Any + tableLfName + Any + NoJoin + Where + NoForUpdate,
+                                    SelectVersion + NoJoin + Any + tableRtName + Any + NoJoin + Where + NoForUpdate
+                                    );
+                            //-SELECT t0.id FROM LSE1x1Rt t0 WHERE t0.id = ? FOR UPDATE WITH RR [params=(int) 1122201]
+                            assertLockTestNoSQLs(Select + NoJoin + Any + tableRtName + Any + NoJoin + Where + ForUpdate
                                     );
                             break;
                         default:

Modified: openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/SequencedActionsTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/SequencedActionsTest.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/SequencedActionsTest.java (original)
+++ openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/SequencedActionsTest.java Fri Nov 27 05:11:21 2009
@@ -573,7 +573,8 @@
                         waitTime = (Integer) args[2];
                     }
                     if (waitTime < MinThreadWaitInMs / 2)
-                        waitTime = MinThreadWaitInMs / 2;                    
+                        waitTime = MinThreadWaitInMs / 2;
+                    log.trace(">> Started wait for " + waitTime + " ms");
                     if( waitThreadid != 0) {
                         thisThread.wait(waitTime);
                     } else {
@@ -581,6 +582,7 @@
                             wait(waitTime);
                         }
                     }
+                    log.trace("<< Ended wait");
                     break;
 
                 case EmployeeNotNull:
@@ -725,7 +727,7 @@
                         new ArrayList<TestThread>(threads);
                     while (proceedThread.size() > 0
                         && System.currentTimeMillis() < endTime) {
-                        for (Thread thread : proceedThread) {
+                        for (TestThread thread : proceedThread) {
                             if (thread.isAlive()) {
                                 log.trace(thread + " is still alive, wait" +
                                     " for 500ms and try again.");
@@ -739,6 +741,9 @@
                                 continue;
                             } else {
                                 deadThreads++;
+                                if(thread.assertError != null){
+                                    throw thread.assertError;
+                                }
                                 proceedThread.remove(thread);
                                 break;
                             }
@@ -823,8 +828,8 @@
                 logStack(ex);
             } catch (Error err) {
                 // only remember the first exception caught
-                if (thisThread.throwable == null) {
-                    thisThread.throwable = err;
+                if (thisThread.assertError == null) {
+                    thisThread.assertError = err;
                 }
                 log.trace("Caught exception and continue: " + err);
                 logStack(err);
@@ -852,11 +857,14 @@
                 }
             }
             em.close();
-            Throwable firstThrowable = thisThread.throwable;
-            if (firstThrowable != null) {
-                if( firstThrowable instanceof Error )
-                    throw (Error)firstThrowable;
+            if (thisThread.assertError != null) {
+                throw thisThread.assertError;
             }
+//            Throwable firstThrowable = thisThread.throwable;            
+//            if (firstThrowable != null) {
+//                if( firstThrowable instanceof Error )
+//                    throw (Error)firstThrowable;
+//            }
             log.trace("<<<< Sequenced Test: Threads=" + threadToRun + '/'
                 + numThreads);
         }
@@ -927,6 +935,7 @@
         private Map<Integer, LockEmployee> employees = null;
 
         public Throwable throwable = null;
+        public Error assertError = null;
         public boolean systemRolledback = false;
 
         public TestThread(int threadToRun, Object[][]... actions) {

Modified: openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerDeadlock.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerDeadlock.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerDeadlock.java (original)
+++ openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerDeadlock.java Fri Nov 27 05:11:21 2009
@@ -48,6 +48,7 @@
 
     /* ======== Find dead lock exception test ============*/
     public void testFindDeadLockException() {
+        commonFindTest("testFindDeadLockException", LockModeType.READ, null); 
         commonFindTest("testFindDeadLockException", LockModeType.WRITE, dbType == DBType.oracle ? null
                 : ExpectingOptimisticLockExClass);
         commonFindTest("testFindDeadLockException", LockModeType.PESSIMISTIC_WRITE, ExpectingAnyLockExClass);
@@ -73,6 +74,7 @@
             
             {Act.WaitAllChildren},
             {Act.TestException, 1, t1Exceptions},
+            {Act.RollbackTx}
         };
         Object[][] thread1 = {
             {Act.CreateEm},
@@ -81,6 +83,7 @@
             {Act.Flush},            
 
             {Act.Notify, 0},
+            {Act.Sleep, 1000},
             {Act.FindWithLock, 1, t1Lock},            
 
             {Act.RollbackTx},
@@ -90,10 +93,11 @@
     
     /* ======== named query dead lock exception test ============*/
     public void testNamedQueryDeadLockException() {
+        commonNamedQueryTest("testNamedQueryDeadLockException", LockModeType.READ, null);
         commonNamedQueryTest("testNamedQueryDeadLockException", LockModeType.WRITE, dbType == DBType.oracle ? null
                 : ExpectingOptimisticLockExClass);
-        commonNamedQueryTest("testNamedQueryDeadLockException", LockModeType.PESSIMISTIC_FORCE_INCREMENT,
-                ExpectingAnyLockExClass);
+//      commonNamedQueryTest("testNamedQueryDeadLockException", LockModeType.PESSIMISTIC_FORCE_INCREMENT,
+//      ExpectingAnyLockExClass);
     }
 
     private void commonNamedQueryTest( String testName, 
@@ -116,6 +120,8 @@
             
             {Act.WaitAllChildren},
             {Act.TestException, 1, t1Exceptions},
+
+            {Act.RollbackTx}
         };
         Object[][] thread1 = {
             {Act.CreateEm},
@@ -124,6 +130,7 @@
             {Act.Flush},            
 
             {Act.Notify, 0},
+            {Act.Sleep, 1000},
             {Act.NamedQueryWithLock, "findEmployeeById", 1, t1Lock, "openjpa.hint.IgnorePreparedQuery", true},            
 
             {Act.RollbackTx},

Modified: openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerFindPermutation.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerFindPermutation.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerFindPermutation.java (original)
+++ openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerFindPermutation.java Fri Nov 27 05:11:21 2009
@@ -38,7 +38,7 @@
         commonFindTest(
             "testFind(Read,Commit/Read,Commit)",
             LockModeType.READ, Act.CommitTx, 1, null, 
-            LockModeType.READ, Act.CommitTx, 0, ExpectingOptimisticLockExClass);
+            LockModeType.READ, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonFindTest(
             "testFind(Read,Commit/Read,Rollback)",
             LockModeType.READ, Act.CommitTx, 1, null,
@@ -49,8 +49,7 @@
         commonFindTest(
             "testFind(Read,Commit/Write,Commit)",
             LockModeType.READ, Act.CommitTx, 1, null,
-            LockModeType.WRITE, Act.CommitTx, 0,
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonFindTest(
             "testFind(Read,Commit/Write,Rollback)",
             LockModeType.READ, Act.CommitTx, 1, null,
@@ -95,7 +94,7 @@
         commonFindTest(
             "testFind(Write,Commit/Read,Commit)",
             LockModeType.WRITE, Act.CommitTx, 1, null, 
-            LockModeType.READ, Act.CommitTx, 0, ExpectingOptimisticLockExClass);
+            LockModeType.READ, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonFindTest(
             "testFind(Write,Commit/Read,Rollback)",
             LockModeType.WRITE, Act.CommitTx, 1, null,
@@ -106,8 +105,7 @@
         commonFindTest(
             "testFind(Write,Commit/Write,Commit)",
             LockModeType.WRITE, Act.CommitTx, 1, null,
-            LockModeType.WRITE, Act.CommitTx, 0,
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonFindTest(
             "testFind(Write,Commit/Write,Rollback)",
             LockModeType.WRITE, Act.CommitTx, 1, null,
@@ -139,8 +137,7 @@
     public void testFindWritePessimisticForceInc() {
         commonFindTest(
             "testFind(Write,Commit/PessimisticForceInc,Commit)",
-            LockModeType.WRITE, Act.CommitTx, 1,
-            ExpectingOptimisticLockExClass, 
+            LockModeType.WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass, 
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null);
         commonFindTest(
             "testFind(Write,Commit/PessimisticForceInc,Rollback)",
@@ -153,7 +150,7 @@
         commonFindTest(
             "testFind(PessimisticRead,Commit/Read,Commit)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null, 
-            LockModeType.READ, Act.CommitTx, 0, ExpectingOptimisticLockExClass);
+            LockModeType.READ, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonFindTest(
             "testFind(PessimisticRead,Commit/Read,Rollback)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null,
@@ -164,8 +161,7 @@
         commonFindTest(
             "testFind(PessimisticRead,Commit/Write,Commit)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null,
-            LockModeType.WRITE, Act.CommitTx, 0, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonFindTest(
             "testFind(PessimisticRead,Commit/Write,Rollback)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null,
@@ -177,12 +173,10 @@
             "testFind(PessimisticRead,Commit/PessimisticRead,Commit)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null, 
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 0, null);
-//                ExpectingOptimisticLockExClass);
         commonFindTest(
             "testFind(PessimisticRead,Commit/PessimisticRead,Rollback)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null,
             LockModeType.PESSIMISTIC_READ, Act.RollbackTx, 0, null); 
-//                ExpectingOptimisticLockExClass);
     }
     
     public void testFindPessimisticReadPessimisticWrite() {
@@ -212,7 +206,7 @@
         commonFindTest(
             "testFind(PessimsiticWrite,Commit/Read,Commit)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null, 
-            LockModeType.READ, Act.CommitTx, 0, ExpectingOptimisticLockExClass);
+            LockModeType.READ, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonFindTest(
             "testFind(PessimsiticWrite,Commit/Read,Rollback)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null,
@@ -223,8 +217,7 @@
         commonFindTest(
             "testFind(PessimsiticWrite,Commit/Write,Commit)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null,
-            LockModeType.WRITE, Act.CommitTx, 0, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonFindTest(
             "testFind(PessimsiticWrite,Commit/Write,Rollback)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null,
@@ -269,7 +262,7 @@
         commonFindTest(
             "testFind(PessimsiticForceInc,Commit/Read,Commit)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null, 
-            LockModeType.READ, Act.CommitTx, 0, ExpectingOptimisticLockExClass);
+            LockModeType.READ, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonFindTest(
             "testFind(PessimsiticForceInc,Commit/Read,Rollback)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null,
@@ -280,8 +273,7 @@
         commonFindTest(
             "testFind(PessimsiticForceInc,Commit/Write,Commit)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null,
-            LockModeType.WRITE, Act.CommitTx, 0,
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonFindTest(
             "testFind(PessimsiticForceInc,Commit/Write,Rollback)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null,

Modified: openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerLockPermutation.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerLockPermutation.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerLockPermutation.java (original)
+++ openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerLockPermutation.java Fri Nov 27 05:11:21 2009
@@ -38,7 +38,7 @@
         commonLockTest(
             "testLock(Read,Commit/Read,Commit)",
             LockModeType.READ, Act.CommitTx, 1, null, 
-            LockModeType.READ, Act.CommitTx, 0, ExpectingOptimisticLockExClass);
+            LockModeType.READ, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(Read,Commit/Read,Rollback)",
             LockModeType.READ, Act.CommitTx, 1, null,
@@ -49,8 +49,7 @@
         commonLockTest(
             "testLock(Read,Commit/Write,Commit)",
             LockModeType.READ, Act.CommitTx, 1, null,
-            LockModeType.WRITE, Act.CommitTx, 0,
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(Read,Commit/Write,Rollback)",
             LockModeType.READ, Act.CommitTx, 1, null,
@@ -95,7 +94,7 @@
         commonLockTest(
             "testLock(Write,Commit/Read,Commit)",
             LockModeType.WRITE, Act.CommitTx, 1, null, 
-            LockModeType.READ, Act.CommitTx, 0, ExpectingOptimisticLockExClass);
+            LockModeType.READ, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(Write,Commit/Read,Rollback)",
             LockModeType.WRITE, Act.CommitTx, 1, null,
@@ -106,8 +105,7 @@
         commonLockTest(
             "testLock(Write,Commit/Write,Commit)",
             LockModeType.WRITE, Act.CommitTx, 1, null,
-            LockModeType.WRITE, Act.CommitTx, 0,
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(Write,Commit/Write,Rollback)",
             LockModeType.WRITE, Act.CommitTx, 1, null,
@@ -139,8 +137,7 @@
     public void testLockWritePessimisticForceInc() {
         commonLockTest(
             "testLock(Write,Commit/PessimisticForceInc,Commit)",
-            LockModeType.WRITE, Act.CommitTx, 1,
-            ExpectingOptimisticLockExClass, 
+            LockModeType.WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass, 
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null);
         commonLockTest(
             "testLock(Write,Commit/PessimisticForceInc,Rollback)",
@@ -153,7 +150,7 @@
         commonLockTest(
             "testLock(PessimisticRead,Commit/Read,Commit)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null, 
-            LockModeType.READ, Act.CommitTx, 0, ExpectingOptimisticLockExClass);
+            LockModeType.READ, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimisticRead,Commit/Read,Rollback)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null,
@@ -164,8 +161,7 @@
         commonLockTest(
             "testLock(PessimisticRead,Commit/Write,Commit)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null,
-            LockModeType.WRITE, Act.CommitTx, 0, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimisticRead,Commit/Write,Rollback)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null,
@@ -176,39 +172,33 @@
         commonLockTest(
             "testLock(PessimisticRead,Commit/PessimisticRead,Commit)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null, 
-            LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimisticRead,Commit/PessimisticRead,Rollback)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null,
-            LockModeType.PESSIMISTIC_READ, Act.RollbackTx, 1, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_READ, Act.RollbackTx, 1, ExpectingOptimisticLockExClass);
     }
     
     public void testLockPessimisticReadPessimisticWrite() {
         commonLockTest(
             "testLock(PessimisticRead,Commit/PessimisticWrite,Commit)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null, 
-            LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimisticRead,Commit/PessimisticWrite,Rollback)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null,
-            LockModeType.PESSIMISTIC_WRITE, Act.RollbackTx, 1,
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_WRITE, Act.RollbackTx, 1, ExpectingOptimisticLockExClass);
     }
     
     public void testLockPessimisticReadPessimisticForceInc() {
         commonLockTest(
             "testLock(PessimisticRead,Commit/PessimisticForceInc,Commit)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null, 
-            LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 2,
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimisticRead,Commit/PessimisticForceInc,Rollback)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, null,
-            LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.RollbackTx, 1,
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.RollbackTx, 1, ExpectingOptimisticLockExClass);
     }
     
     /* ======== Thread 1 : Pessimsitic Write Lock ============*/
@@ -216,7 +206,7 @@
         commonLockTest(
             "testLock(PessimsiticWrite,Commit/Read,Commit)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null, 
-            LockModeType.READ, Act.CommitTx, 0, ExpectingOptimisticLockExClass);
+            LockModeType.READ, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimsiticWrite,Commit/Read,Rollback)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null,
@@ -227,8 +217,7 @@
         commonLockTest(
             "testLock(PessimsiticWrite,Commit/Write,Commit)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null,
-            LockModeType.WRITE, Act.CommitTx, 0, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimsiticWrite,Commit/Write,Rollback)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null,
@@ -239,39 +228,33 @@
         commonLockTest(
             "testLock(PessimsiticWrite,Commit/PessimisticRead,Commit)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null, 
-            LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimsiticWrite,Commit/PessimisticRead,Rollback)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null,
-            LockModeType.PESSIMISTIC_READ, Act.RollbackTx, 1, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_READ, Act.RollbackTx, 1, ExpectingOptimisticLockExClass);
     }
     
     public void testLockPessimsiticWritePessimisticWrite() {
         commonLockTest(
             "testLock(PessimsiticWrite,Commit/PessimisticWrite,Commit)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null, 
-            LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimsiticWrite,Commit/PessimisticWrite,Rollback)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null,
-            LockModeType.PESSIMISTIC_WRITE, Act.RollbackTx, 1, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_WRITE, Act.RollbackTx, 1, ExpectingOptimisticLockExClass);
     }
     
     public void testLockPessimsiticWritePessimisticForceInc() {
         commonLockTest(
             "testLock(PessimsiticWrite,Commit/PessimisticForceInc,Commit)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null, 
-            LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 2, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimsiticWrite,Commit/PessimisticForceInc,Rollback)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, null,
-            LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.RollbackTx, 1,
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.RollbackTx, 1, ExpectingOptimisticLockExClass);
     }
     
     /* ======== Thread 1 : Pessimsitic Force Increment Lock ============*/
@@ -279,7 +262,7 @@
         commonLockTest(
             "testLock(PessimsiticForceInc,Commit/Read,Commit)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null, 
-            LockModeType.READ, Act.CommitTx, 0, ExpectingOptimisticLockExClass);
+            LockModeType.READ, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimsiticForceInc,Commit/Read,Rollback)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null,
@@ -290,8 +273,7 @@
         commonLockTest(
             "testLock(PessimsiticForceInc,Commit/Write,Commit)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null,
-            LockModeType.WRITE, Act.CommitTx, 0,
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimsiticForceInc,Commit/Write,Rollback)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null,
@@ -302,39 +284,33 @@
         commonLockTest(
             "testLock(PessimsiticForceInc,Commit/PessimisticRead,Commit)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null, 
-            LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_READ, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimsiticForceInc,Commit/PessimisticRead,Rollback)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null,
-            LockModeType.PESSIMISTIC_READ, Act.RollbackTx, 1, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_READ, Act.RollbackTx, 1, ExpectingOptimisticLockExClass);
     }
     
     public void testLockPessimsiticForceIncPessimisticWrite() {
         commonLockTest(
             "testLock(PessimsiticForceInc,Commit/PessimisticWrite,Commit)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null, 
-            LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimsiticForceInc,Commit/PessimisticWrite,Rollback)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null,
-            LockModeType.PESSIMISTIC_WRITE, Act.RollbackTx, 1, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_WRITE, Act.RollbackTx, 1, ExpectingOptimisticLockExClass);
     }
     
     public void testLockPessimsiticForceIncPessimisticForceInc() {
         commonLockTest(
             "testLock(PessimsiticForceInc,Commit/PessimisticForceInc,Commit)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null, 
-            LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 2, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, ExpectingOptimisticLockExClass);
         commonLockTest(
             "testLock(PessimsiticForceInc,Commit/PessimisticForceInc,Rollback)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 1, null,
-            LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.RollbackTx, 1, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.RollbackTx, 1, ExpectingOptimisticLockExClass);
     }
 
     private void commonLockTest( String testName, 

Modified: openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerRefreshPermutation.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerRefreshPermutation.java?rev=884744&r1=884743&r2=884744&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerRefreshPermutation.java (original)
+++ openjpa/trunk/openjpa-persistence-locking/src/test/java/org/apache/openjpa/persistence/lockmgr/TestMixedLockManagerRefreshPermutation.java Fri Nov 27 05:11:21 2009
@@ -107,8 +107,7 @@
         commonRefreshTest(
             "testRefresh(Write,Commit/Write,Commit)",
             LockModeType.WRITE, Act.CommitTx, 2, null,
-            LockModeType.WRITE, Act.CommitTx, 2,
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 2, ExpectingOptimisticLockExClass);
         commonRefreshTest(
             "testRefresh(Write,Commit/Write,Rollback)",
             LockModeType.WRITE, Act.CommitTx, 2, null,
@@ -140,8 +139,7 @@
     public void testRefreshWritePessimisticForceInc() {
         commonRefreshTest(
             "testRefresh(Write,Commit/PessimisticForceInc,Commit)",
-            LockModeType.WRITE, Act.CommitTx, 2,
-            ExpectingOptimisticLockExClass,
+            LockModeType.WRITE, Act.CommitTx, 2, ExpectingOptimisticLockExClass,
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 2, null);
         commonRefreshTest(
             "testRefresh(Write,Commit/PessimisticForceInc,Rollback)",
@@ -165,8 +163,7 @@
         commonRefreshTest(
             "testRefresh(PessimisticRead,Commit/Write,Commit)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 2, null,
-            LockModeType.WRITE, Act.CommitTx, 2, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 2, ExpectingOptimisticLockExClass);
         commonRefreshTest(
             "testRefresh(PessimisticRead,Commit/Write,Rollback)",
             LockModeType.PESSIMISTIC_READ, Act.CommitTx, 2, null,
@@ -206,7 +203,7 @@
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.RollbackTx, 2, null);
     }
     
-    /* ======== Thread 1 : Pessimsitic Write Lock ============*/
+    /* ======== Thread 1 : Pessimistic Write Lock ============*/
     public void testRefreshPessimsiticWriteRead() {
         commonRefreshTest(
             "testRefresh(PessimsiticWrite,Commit/Read,Commit)",
@@ -222,8 +219,7 @@
         commonRefreshTest(
             "testRefresh(PessimsiticWrite,Commit/Write,Commit)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 2, null,
-            LockModeType.WRITE, Act.CommitTx, 2, 
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 2, ExpectingOptimisticLockExClass);
         commonRefreshTest(
             "testRefresh(PessimsiticWrite,Commit/Write,Rollback)",
             LockModeType.PESSIMISTIC_WRITE, Act.CommitTx, 2, null,
@@ -268,7 +264,7 @@
         commonRefreshTest(
             "testRefresh(PessimsiticForceInc,Commit/Read,Commit)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 2, null, 
-            LockModeType.READ, Act.CommitTx, 0, ExpectingOptimisticLockExClass);
+            LockModeType.READ, Act.CommitTx, 2, ExpectingOptimisticLockExClass);
         commonRefreshTest(
             "testRefresh(PessimsiticForceInc,Commit/Read,Rollback)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 2, null,
@@ -279,8 +275,7 @@
         commonRefreshTest(
             "testRefresh(PessimsiticForceInc,Commit/Write,Commit)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 2, null,
-            LockModeType.WRITE, Act.CommitTx, 0,
-                ExpectingOptimisticLockExClass);
+            LockModeType.WRITE, Act.CommitTx, 2, ExpectingOptimisticLockExClass);
         commonRefreshTest(
             "testRefresh(PessimsiticForceInc,Commit/Write,Rollback)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 2, null,
@@ -311,13 +306,11 @@
     
     public void testRefreshPessimsiticForceIncPessimisticForceInc() {
         commonRefreshTest(
-            "testRefresh(PessimsiticForceInc,Commit/" 
-                + "PessimisticForceInc,Commit)",
+            "testRefresh(PessimsiticForceInc,Commit/PessimisticForceInc,Commit)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 3, null, 
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 3, null);
         commonRefreshTest(
-            "testRefresh(PessimsiticForceInc,Commit/"
-                + "PessimisticForceInc,Rollback)",
+            "testRefresh(PessimsiticForceInc,Commit/PessimisticForceInc,Rollback)",
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.CommitTx, 2, null,
             LockModeType.PESSIMISTIC_FORCE_INCREMENT, Act.RollbackTx, 2, null); 
     }



Mime
View raw message