Issue Details (XML | Word | Printable)

Key: JDO-58
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Michael Watzek
Reporter: Michelle Caisse
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

Test hangs: AfterCloseGetPMThrowsException

Created: 27/May/05 06:17 AM   Updated: 23/Apr/06 02:30 AM
Return to search
Component/s: tck2
Affects Version/s: None
Fix Version/s: JDO 2 beta

Time Tracking:
Not Specified

Resolution Date: 23/Apr/06 02:30 AM


 Description  « Hide
api.persistencemanagerfactory.AfterCloseGetPMThrowsException never returns after producing the following:

    [echo] Run TCK test org.apache.jdo.tck.api.persistencemanagerfactory.AfterCloseGetPMThrowsException on the
    [java] [FATAL] tck - Exception during setUp or runtest: <javax.jdo.JDOFatalUserException: Can't access or
Can't access or use PersistenceManagerFactory after it has been closed.
    [java] at org.jpox.AbstractPersistenceManagerFactory.assertIsOpen(AbstractPersistenceManagerFactory.j
    [java] at org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.
    [java] at org.apache.jdo.tck.api.persistencemanagerfactory.AfterCloseGetPMThrowsException.test(AfterC
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java] at java.lang.reflect.Method.invoke(Method.java:324)
    [java] at junit.framework.TestCase.runTest(TestCase.java:154)
    [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:181)
    [java] at junit.framework.TestResult$1.protect(TestResult.java:106)
    [java] at junit.framework.TestResult.runProtected(TestResult.java:124)
    [java] at junit.framework.TestResult.run(TestResult.java:109)
    [java] at junit.framework.TestCase.run(TestCase.java:118)
    [java] at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [java] at junit.framework.TestSuite.run(TestSuite.java:203)
    [java] at junit.textui.TestRunner.doRun(TestRunner.java:116)
    [java] at junit.textui.TestRunner.doRun(TestRunner.java:109)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.run(BatchTestRunner.java:75)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.run(BatchTestRunner.java:70)
    [java] at org.apache.jdo.tck.api.persistencemanagerfactory.AfterCloseGetPMThrowsException.main(AfterC
    [java]
    [java] [FATAL] tck - Exception during localTearDown: <javax.jdo.JDOFatalUserException: Can't access or us
't access or use PersistenceManagerFactory after it has been closed.
    [java] at org.jpox.AbstractPersistenceManagerFactory.assertIsOpen(AbstractPersistenceManagerFactory.j
    [java] at org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.
    [java] at org.apache.jdo.tck.JDO_Test.getPM(JDO_Test.java:363)
    [java] at org.apache.jdo.tck.JDO_Test.deleteAndUnregisterPCInstances(JDO_Test.java:291)
    [java] at org.apache.jdo.tck.JDO_Test.localTearDown(JDO_Test.java:266)
    [java] at org.apache.jdo.tck.JDO_Test.tearDown(JDO_Test.java:237)
    [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:193)
    [java] at junit.framework.TestResult$1.protect(TestResult.java:106)
    [java] at junit.framework.TestResult.runProtected(TestResult.java:124)
    [java] at junit.framework.TestResult.run(TestResult.java:109)
    [java] at junit.framework.TestCase.run(TestCase.java:118)
    [java] at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [java] at junit.framework.TestSuite.run(TestSuite.java:203)
    [java] at junit.textui.TestRunner.doRun(TestRunner.java:116)
    [java] at junit.textui.TestRunner.doRun(TestRunner.java:109)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.run(BatchTestRunner.java:75)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.run(BatchTestRunner.java:70)
    [java] at org.apache.jdo.tck.api.persistencemanagerfactory.AfterCloseGetPMThrowsException.main(AfterC
    [java]

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Michelle Caisse added a comment - 27/May/05 06:20 AM
Problem started with jpox.20050525.022048.jar, also seen w/ jpox.20050526.*

Michelle Caisse added a comment - 27/May/05 01:38 PM
Also:
    [java] RUN TransientTransactionalInstanceRetainsValuesAtCommit.testTransientTransactionalInstanceRetainsValuesAtCommit
    [java] [FATAL] tck - Exception during localTearDown: <javax.jdo.JDOFatalUserException: Can't access or use PersistenceManagerFactory after it has been closed.>javax.jdo.JDOFatalUserException: Can't access or use PersistenceManagerFactory after it has been closed.
    [java] at org.jpox.AbstractPersistenceManagerFactory.assertIsOpen(AbstractPersistenceManagerFactory.java:136)
    [java] at org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:645)
    [java] at org.apache.jdo.tck.JDO_Test.getPM(JDO_Test.java:363)
    [java] at org.apache.jdo.tck.JDO_Test.deleteAndUnregisterPCInstances(JDO_Test.java:291)
    [java] at org.apache.jdo.tck.JDO_Test.localTearDown(JDO_Test.java:266)
    [java] at org.apache.jdo.tck.JDO_Test.tearDown(JDO_Test.java:237)
    [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:193)
    [java] at junit.framework.TestResult$1.protect(TestResult.java:106)
    [java] at junit.framework.TestResult.runProtected(TestResult.java:124)
    [java] at junit.framework.TestResult.run(TestResult.java:109)
    [java] at junit.framework.TestCase.run(TestCase.java:118)
    [java] at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [java] at junit.framework.TestSuite.run(TestSuite.java:203)
    [java] at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [java] at junit.framework.TestSuite.run(TestSuite.java:203)
    [java] at junit.textui.TestRunner.doRun(TestRunner.java:116)
    [java] at junit.textui.TestRunner.doRun(TestRunner.java:109)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:112)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:90)
    [java]

Michael Watzek added a comment - 02/Jun/05 08:47 PM
There are 5 tests (AfterCloseGetPMThrowsException, AfterCloseSetMethodsThrowException, Close, CloseFailsIfTransactionActive, CloseWithoutPermissionThrowsSecurityException) that call "getPMF()" and "pmf.close()" in their "testXXX" methods , but they do not nullify field "pmf". All of those tests fail in "localTearDown": "localTearDown" calls "getPMF()" which returns field "pmf" if it is not null. For this reason, "getPMF()" returnes a closed PMF in those tests.

The fix is to add a check before "localTearDown" is called:

if (pmf!=null && pmf.isClosed())
    pmf = null;

Additionally, we add another check before this check, ensuring that TCK tests do not close and/or nullify the PMF instance when they add teardown instances and/or classes:

if ((pmf == null || pmf.isClosed()) &&
    (this.tearDownInstances.size() > 0 || this.tearDownClasses.size() > 0))
   throw new JDOFatalException ("PMF must not be nullified or closed when tear down instances and /or classes have been added.");

Michael Bouschen added a comment - 23/Apr/06 02:18 AM
Reopened to set the Fix Version/s field to JDO 2 beta.