You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by cl...@apache.org on 2005/04/23 06:40:24 UTC
svn commit: r164333 -
/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceNotInDatastore.java
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");
}