OpenJPA
  1. OpenJPA
  2. OPENJPA-1285

Dynamic JDBC4 connection wrapper should maintain constructor refernce for faster instantiation

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M2
    • Fix Version/s: 2.0.0-M3
    • Component/s: performance
    • Labels:
      None

      Issue Links

        Activity

        Donald Woods made changes -
        Fix Version/s 2.0.0 [ 12314019 ]
        Fix Version/s 2.0.0-M4 [ 12314149 ]
        Affects Version/s 2.0.0-M1 [ 12313624 ]
        Affects Version/s 2.0.0 [ 12314019 ]
        Affects Version/s 2.0.0-M3 [ 12314148 ]
        Affects Version/s 2.0.0-M4 [ 12314149 ]
        Pinaki Poddar made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Pinaki Poddar added a comment -

        Thanks Fay – missed that.

        Show
        Pinaki Poddar added a comment - Thanks Fay – missed that.
        Hide
        Jeremy Bauer added a comment -

        This change also appears to have caused some failures on tests that run on platforms other than Derby (DB2, MySQL, Oracle, SQL Server...). Tests in error are org.apache.openjpa.jdbc.meta.strats.TestInputStreamLob and org.apache.openjpa.jdbc.meta.strats.TestReaderLob. Here's a stack from one of the failing tests:

        java.lang.ExceptionInInitializerError
        at org.apache.openjpa.lib.util.ConcreteClassGenerator.newInstance(ConcreteClassGenerator.java:132)
        at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$RefCountConnection.prepareStatement(JDBCStoreManager.java:1543)
        at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:317)
        at org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:546)
        at org.apache.openjpa.jdbc.sql.DBDictionary.updateClob(DBDictionary.java:4703)
        at org.apache.openjpa.jdbc.meta.strats.LobFieldStrategy.customInsert(LobFieldStrategy.java:115)
        at org.apache.openjpa.jdbc.meta.FieldMapping.customInsert(FieldMapping.java:801)
        at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager$CustomMapping.execute(AbstractUpdateManager.java:426)
        at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:117)
        at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:76)
        at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:677)
        at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
        at org.apache.openjpa.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:561)
        at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
        at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2096)
        at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1994)
        at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1912)
        at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
        at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1436)
        at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:895)
        at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:562)
        at org.apache.openjpa.jdbc.meta.strats.AbstractLobTest.insert(AbstractLobTest.java:71)
        at org.apache.openjpa.jdbc.meta.strats.AbstractLobTest.testInsert(AbstractLobTest.java:77)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.runBare(AbstractPersistenceTestCase.java:498)
        at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.runBare(AbstractPersistenceTestCase.java:474)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.run(AbstractPersistenceTestCase.java:176)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
        Caused by: java.lang.IllegalArgumentException
        at sun.reflect.GeneratedConstructorAccessor40.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at org.apache.openjpa.lib.util.ConcreteClassGenerator.newInstance(ConcreteClassGenerator.java:130)

        Show
        Jeremy Bauer added a comment - This change also appears to have caused some failures on tests that run on platforms other than Derby (DB2, MySQL, Oracle, SQL Server...). Tests in error are org.apache.openjpa.jdbc.meta.strats.TestInputStreamLob and org.apache.openjpa.jdbc.meta.strats.TestReaderLob. Here's a stack from one of the failing tests: java.lang.ExceptionInInitializerError at org.apache.openjpa.lib.util.ConcreteClassGenerator.newInstance(ConcreteClassGenerator.java:132) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$RefCountConnection.prepareStatement(JDBCStoreManager.java:1543) at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:317) at org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:546) at org.apache.openjpa.jdbc.sql.DBDictionary.updateClob(DBDictionary.java:4703) at org.apache.openjpa.jdbc.meta.strats.LobFieldStrategy.customInsert(LobFieldStrategy.java:115) at org.apache.openjpa.jdbc.meta.FieldMapping.customInsert(FieldMapping.java:801) at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager$CustomMapping.execute(AbstractUpdateManager.java:426) at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:117) at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:76) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:677) at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130) at org.apache.openjpa.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:561) at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130) at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2096) at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1994) at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1912) at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81) at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1436) at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:895) at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:562) at org.apache.openjpa.jdbc.meta.strats.AbstractLobTest.insert(AbstractLobTest.java:71) at org.apache.openjpa.jdbc.meta.strats.AbstractLobTest.testInsert(AbstractLobTest.java:77) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.runBare(AbstractPersistenceTestCase.java:498) at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.runBare(AbstractPersistenceTestCase.java:474) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.run(AbstractPersistenceTestCase.java:176) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) at org.apache.maven.surefire.Surefire.run(Surefire.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) Caused by: java.lang.IllegalArgumentException at sun.reflect.GeneratedConstructorAccessor40.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at org.apache.openjpa.lib.util.ConcreteClassGenerator.newInstance(ConcreteClassGenerator.java:130)
        Hide
        Donald Woods added a comment -

        Looks like the changes in r813149 is causing some test failures on IBM 6 SDK, but not on Sun JDK 6 -

        TestExceptionsFromCallbacks.testPostUpdateExceptionDuringFlushWithNewFlushedInstance View test details (org.apache.openjpa.persistence.callbacks)
        java.lang.IncompatibleClassChangeError
        at org.apache.openjpa.jdbc.meta.MappingInfo.createIndex(MappingInfo.java:904)
        at org.apache.openjpa.jdbc.meta.VersionMappingInfo.getIndex(VersionMappingInfo.java:112)
        Please wait... Show stacktrace »
        « Hide stacktrace
        java.lang.IncompatibleClassChangeError
        at org.apache.openjpa.jdbc.meta.MappingInfo.createIndex(MappingInfo.java:904)
        at org.apache.openjpa.jdbc.meta.VersionMappingInfo.getIndex(VersionMappingInfo.java:112)
        at org.apache.openjpa.jdbc.meta.strats.ColumnVersionStrategy.map(ColumnVersionStrategy.java:171)
        at org.apache.openjpa.jdbc.meta.Version.setStrategy(Version.java:102)
        at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:85)
        at org.apache.openjpa.jdbc.meta.Version.resolveMapping(Version.java:259)
        at org.apache.openjpa.jdbc.meta.Version.resolve(Version.java:241)
        at org.apache.openjpa.jdbc.meta.ClassMapping.resolveNonRelationMappings(ClassMapping.java:895)
        at org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping(MappingRepository.java:344)
        at org.apache.openjpa.meta.MetaDataRepository.preMapping(MetaDataRepository.java:677)
        at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:564)
        at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:323)
        at org.apache.openjpa.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:290)
        at org.apache.openjpa.jdbc.meta.MappingTool.getMapping(MappingTool.java:676)
        at org.apache.openjpa.jdbc.meta.MappingTool.buildSchema(MappingTool.java:748)
        at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:646)
        at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:152)
        at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:162)
        at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:118)
        at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:201)
        at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:152)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:199)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:150)
        at org.apache.openjpa.persistence.callbacks.TestExceptionsFromCallbacks.testPostUpdateExceptionDuringFlushWithNewFlushedInstance(TestExceptionsFromCallbacks.java:278)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        Show
        Donald Woods added a comment - Looks like the changes in r813149 is causing some test failures on IBM 6 SDK, but not on Sun JDK 6 - TestExceptionsFromCallbacks.testPostUpdateExceptionDuringFlushWithNewFlushedInstance View test details (org.apache.openjpa.persistence.callbacks) java.lang.IncompatibleClassChangeError at org.apache.openjpa.jdbc.meta.MappingInfo.createIndex(MappingInfo.java:904) at org.apache.openjpa.jdbc.meta.VersionMappingInfo.getIndex(VersionMappingInfo.java:112) Please wait... Show stacktrace » « Hide stacktrace java.lang.IncompatibleClassChangeError at org.apache.openjpa.jdbc.meta.MappingInfo.createIndex(MappingInfo.java:904) at org.apache.openjpa.jdbc.meta.VersionMappingInfo.getIndex(VersionMappingInfo.java:112) at org.apache.openjpa.jdbc.meta.strats.ColumnVersionStrategy.map(ColumnVersionStrategy.java:171) at org.apache.openjpa.jdbc.meta.Version.setStrategy(Version.java:102) at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:85) at org.apache.openjpa.jdbc.meta.Version.resolveMapping(Version.java:259) at org.apache.openjpa.jdbc.meta.Version.resolve(Version.java:241) at org.apache.openjpa.jdbc.meta.ClassMapping.resolveNonRelationMappings(ClassMapping.java:895) at org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping(MappingRepository.java:344) at org.apache.openjpa.meta.MetaDataRepository.preMapping(MetaDataRepository.java:677) at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:564) at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:323) at org.apache.openjpa.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:290) at org.apache.openjpa.jdbc.meta.MappingTool.getMapping(MappingTool.java:676) at org.apache.openjpa.jdbc.meta.MappingTool.buildSchema(MappingTool.java:748) at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:646) at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:152) at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:162) at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:118) at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:201) at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:152) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:199) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:150) at org.apache.openjpa.persistence.callbacks.TestExceptionsFromCallbacks.testPostUpdateExceptionDuringFlushWithNewFlushedInstance(TestExceptionsFromCallbacks.java:278) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        Pinaki Poddar made changes -
        Field Original Value New Value
        Link This issue is part of OPENJPA-5 [ OPENJPA-5 ]
        Pinaki Poddar created issue -

          People

          • Assignee:
            Pinaki Poddar
            Reporter:
            Pinaki Poddar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development