db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r164333 - /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceNotInDatastore.java
Date Sat, 23 Apr 2005 04:40:24 GMT
Author: clr
Date: Fri Apr 22 21:40:23 2005
New Revision: 164333

URL: http://svn.apache.org/viewcvs?rev=164333&view=rev
Log:
JDO-28 accessing an instance must be done in a transaction

Modified:
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceNotInDatastore.java

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceNotInDatastore.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceNotInDatastore.java?rev=164333&r1=164332&r2=164333&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceNotInDatastore.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceNotInDatastore.java
Fri Apr 22 21:40:23 2005
@@ -64,18 +64,19 @@
         deletePCPointInstance(pm, oid);
     
         try {
+            pm.currentTransaction().begin();
             PCPoint p1 = (PCPoint)pm.getObjectById(oid, false); // might throw exception
here
             if (debug)
                 logger.debug ("Got object in cache, even though not in datastore.");
             p1.getX(); // if not thrown above, throws exception here
+            pm.currentTransaction().commit();
             fail(ASSERTION_FAILED,
                  "accessing unknown instance should throw JDOObjectNotFoundException");
         } 
         catch (JDOObjectNotFoundException ex) {
             // expected exception
         }
-        pm.close();
-        pm = null;
+        cleanup();
         if (debug)
             logger.debug ("END GetObjectByIdNoValidationInstanceNotInDatastore");
    }



Mime
View raw message