db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r462525 - /db/jdo/branches/2.0.1/tck20/src/java/org/apache/jdo/tck/lifecycle/StateTransitionsReturnedObjects.java
Date Tue, 10 Oct 2006 19:43:36 GMT
Author: clr
Date: Tue Oct 10 12:43:35 2006
New Revision: 462525

URL: http://svn.apache.org/viewvc?view=rev&rev=462525
Log:
JDO-427 JDO-429 JDO-431
StateTransitionsReturnedObjects.java is modified to make several state transitions
UNSPECIFIED, since the specification is ambiguous.
These changes apply only to the branches/2.0.1, as we intend to clarify the
specification for JDO 2.1 maintenance release.

Modified:
    db/jdo/branches/2.0.1/tck20/src/java/org/apache/jdo/tck/lifecycle/StateTransitionsReturnedObjects.java

Modified: db/jdo/branches/2.0.1/tck20/src/java/org/apache/jdo/tck/lifecycle/StateTransitionsReturnedObjects.java
URL: http://svn.apache.org/viewvc/db/jdo/branches/2.0.1/tck20/src/java/org/apache/jdo/tck/lifecycle/StateTransitionsReturnedObjects.java?view=diff&rev=462525&r1=462524&r2=462525
==============================================================================
--- db/jdo/branches/2.0.1/tck20/src/java/org/apache/jdo/tck/lifecycle/StateTransitionsReturnedObjects.java
(original)
+++ db/jdo/branches/2.0.1/tck20/src/java/org/apache/jdo/tck/lifecycle/StateTransitionsReturnedObjects.java
Tue Oct 10 12:43:35 2006
@@ -89,6 +89,7 @@
     private static final int ERROR                       = -2;
     private static final int IMPOSSIBLE                  = -3;
     private static final int NOT_APPLICABLE              = -4;
+    private static final int UNSPECIFIED                 = -5;
 
     /**
      * State transitions
@@ -109,7 +110,7 @@
 
         // detachCopy outside tx
         {   ERROR,                          IMPOSSIBLE,                         IMPOSSIBLE,
-            IMPOSSIBLE,                     DETACHED_CLEAN,                     IMPOSSIBLE,
+            IMPOSSIBLE,                     UNSPECIFIED,                        IMPOSSIBLE,
             IMPOSSIBLE,                     IMPOSSIBLE,                         IMPOSSIBLE,
             DETACHED_CLEAN,                 ERROR,                              UNCHANGED,
             DETACHED_CLEAN},
@@ -118,8 +119,8 @@
         {   DETACHED_CLEAN,                 DETACHED_CLEAN,                     DETACHED_CLEAN,
             DETACHED_CLEAN,                 DETACHED_CLEAN,                     DETACHED_CLEAN,
             DETACHED_CLEAN,                 ERROR,                              ERROR,
-            DETACHED_CLEAN,                 ERROR,                              UNCHANGED,
-            DETACHED_CLEAN},
+            DETACHED_CLEAN,                 ERROR,                              UNSPECIFIED,
+            UNSPECIFIED},
 
         // serialize outside tx
         {   UNCHANGED,                      IMPOSSIBLE,                         IMPOSSIBLE,
@@ -131,8 +132,8 @@
         // serialize with active tx
         {   UNCHANGED,                      DETACHED_CLEAN,                     DETACHED_CLEAN,
             DETACHED_CLEAN,                 DETACHED_CLEAN,                     TRANSIENT,
-            TRANSIENT,                      TRANSIENT,                          TRANSIENT,
-            DETACHED_CLEAN,                 TRANSIENT,                          UNCHANGED,
+            TRANSIENT,                      UNSPECIFIED,                        UNSPECIFIED,
+            DETACHED_CLEAN,                 UNSPECIFIED,                        UNCHANGED,
             UNCHANGED},
     };
 
@@ -147,10 +148,7 @@
     private static final boolean[][] applies_to_scenario = {
         //  Datastore   Optimistic      No tx
         {   true,          true,        false },  // makePersistent
-        // since the spec leaves detachCopy outside tx a bit underspecified,
-        // we decided to disable this scanario for now
-        //{   false,         false,       true },   // detachCopy outside tx
-        {   false,         false,       false },   // detachCopy outside tx
+        {   false,         false,       true },   // detachCopy outside tx
         {   true,          true,        false },  // detachCopy with active tx
         {   false,         false,       true },   // serialize outside tx
         {   true,          true,        false }   // serialize with active tx
@@ -258,6 +256,7 @@
                 expected_state = statesOfReturnedObjects[operation][current_state];
                 if( expected_state == IMPOSSIBLE ) continue;
                 if( expected_state == NOT_APPLICABLE ) continue;
+                if( expected_state == UNSPECIFIED ) continue;
                 if( expected_state == UNCHANGED ) expected_state = current_state;
                 try {
                     transaction = pm.currentTransaction();



Mime
View raw message