Bug 294111

Summary: JPA:Derby:[Testing] testEMCloseAndOpen intermittent NPE reproduced with embedded derby driver
Product: z_Archived Reporter: Michael OBrien <michael.f.obrien>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.orm-inbox, tom.ware
Version: unspecifiedKeywords: test
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Michael OBrien CLA 2009-11-03 15:19:38 EST
>It looks like the following line needs a NPE and/or an .isOpen() check before closing the connection.
This can be reproduced by running derby with the following non-tx url that is actually an invalid configuration for our tests but one that may come up.


>test.properties
jdbc.driver.jar=${extensions.depend.dir}/derby.jar:${extensions.depend.dir}/derbyclient.jar
db.driver=org.apache.derby.jdbc.ClientDriver
db.url=jdbc:derby:eclipselink;create=true
db.user=app
db.pwd=app
db.platform=org.eclipse.persistence.platform.database.DerbyPlatform


>ant test-jpa
---------------------XML report
testEMCloseAndOpen Error N/A 

java.lang.NullPointerException
at org.eclipse.persistence.testing.framework.ConnectionWrapper.close(ConnectionWrapper.java:173)
at org.eclipse.persistence.testing.framework.DriverWrapper.clear(DriverWrapper.java:176)
at org.eclipse.persistence.testing.tests.jpa.advanced.EntityManagerJUnitTestSuite.testEMCloseAndOpen(EntityManagerJUnitTestSuite.java:8392)
at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBare(JUnitTestCase.java:428)
 0.078 
testEMFactoryCloseAndOpen Error N/A 

java.lang.NullPointerException
at org.eclipse.persistence.testing.framework.ConnectionWrapper.close(ConnectionWrapper.java:173)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.closeDatasourceConnection(DatabaseAccessor.java:467)
at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.disconnect(DatasourceAccessor.java:477)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.disconnect(DatabaseAccessor.java:479)
at org.eclipse.persistence.sessions.server.ConnectionPool.shutDown(ConnectionPool.java:411)
at org.eclipse.persistence.sessions.server.ServerSession.logout(ServerSession.java:678)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.removeSessionFromGlobalSessionManager(EntityManagerSetupImpl.java:270)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.undeploy(EntityManagerSetupImpl.java:1596)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:174)
at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.closeEntityManagerFactory(JUnitTestCase.java:398)
at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.closeEntityManagerFactory(JUnitTestCase.java:391)
at org.eclipse.persistence.testing.tests.jpa.advanced.EntityManagerJUnitTestSuite.testEMFactoryCloseAndOpen(EntityManagerJUnitTestSuite.java:8423)
at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBare(JUnitTestCase.java:428)
 0.031 
testNoPersistOnCommit Error Attempting to execute an operation on a closed EntityManagerFactory. 

java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory.
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.verifyOpen(EntityManagerFactoryImpl.java:218)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:201)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:190)
at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.createEntityManager(JUnitTestCase.java:291)
at org.eclipse.persistence.testing.tests.jpa.advanced.EntityManagerJUnitTestSuite.testNoPersistOnCommit(EntityManagerJUnitTestSuite.java:2745)
at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBare(JUnitTestCase.java:428)
Comment 1 Michael OBrien CLA 2009-11-03 15:20:45 EST
>config
F:\view_w35b>java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)

>Derby 10530
Comment 2 Michael OBrien CLA 2009-11-03 15:25:09 EST
    public void close() throws SQLException {
        if(broken) {
            throw new SQLException(getExceptionString());
        }
--->    conn.close();
    }
Comment 3 Tom Ware CLA 2009-11-05 09:21:17 EST
Closing - The embeddable Derby driver does not provide adequate JDBC support to expect all our tests to run.  We have no intention of doing any work to make tests run on Embedded Derby.
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:15:38 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:32:12 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink