You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Vincent MATHON (JIRA)" <ji...@apache.org> on 2009/01/30 14:51:59 UTC

[jira] Created: (OPENEJB-996) JDBC connection are not released correctly with intra VM Open EJB

JDBC connection are not released correctly with intra VM Open EJB
-----------------------------------------------------------------

                 Key: OPENEJB-996
                 URL: https://issues.apache.org/jira/browse/OPENEJB-996
             Project: OpenEJB
          Issue Type: Bug
    Affects Versions: 3.1
         Environment: maven 2.0.9, EJB3, Windows 2000, Eclipse 3.4.1, Maven Integration For Eclipse 0.9.6
            Reporter: Vincent MATHON


I have built a Junit test case from The movies OpenEJB example.

I have two SLSB with Required Tx. I have configured a pool with only 1 instance to obtain predictive behaviour.
The first SLSB save an entity (a movie) without throwing exception whereas the second always throw a triggered exception after persisting the movie (this is an ApplicationException with rollback=true but I can reproduce the bug with a RuntimeException too).

I can run five times (and more) the first SLSB without any problem. When I run twice the second SLSB I obtain the following exception:

#########################################################################################
############################# WITHOUT EXCEPTION #########################################
#########################################################################################
############################# FIRST RUN ... #############################################
############################# SECOND RUN ... #############################################
############################# THIRD RUN ... #############################################
############################# FOURTH RUN ... #############################################
############################# FIFTH RUN ... #############################################
#########################################################################################
############################# WITH EXCEPTION ############################################
#########################################################################################
############################# FIRST RUN ... #############################################
############################# SECOND RUN (Should Block) ... #############################
WARN - Unexpected exception from beforeCompletion; transaction will roll back
<openjpa-1.1.0-r422266:659716 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Unable to acquire a new connection from the pool
	at org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4150)
	at org.apache.openjpa.jdbc.sql.HSQLDictionary.newStoreException(HSQLDictionary.java:292)
	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:762)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.retainConnection(JDBCStoreManager.java:201)
	at org.apache.openjpa.kernel.DelegatingStoreManager.retainConnection(DelegatingStoreManager.java:163)
	at org.apache.openjpa.kernel.BrokerImpl.retainConnection(BrokerImpl.java:3700)
	at org.apache.openjpa.kernel.BrokerImpl.beginStoreManagerTransaction(BrokerImpl.java:1280)
	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1965)
	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1905)
	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1823)
	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:515)
	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:500)
	at org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:473)
	at org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:258)
	at org.apache.openejb.core.transaction.JtaTransactionPolicy.rollbackTransaction(JtaTransactionPolicy.java:333)
	at org.apache.openejb.core.transaction.JtaTransactionPolicy.completeTransaction(JtaTransactionPolicy.java:283)
	at org.apache.openejb.core.transaction.TxRequired.commit(TxRequired.java:71)
	at org.apache.openejb.core.transaction.EjbTransactionUtil.afterInvoke(EjbTransactionUtil.java:74)
	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:231)
	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169)
	at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
	at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
	at $Proxy23.addMovie(Unknown Source)
	at org.superbiz.injection.tx.MoviesTest.testConnectionUnreleasedCorrectlyWhenExceptionIsThrown(MoviesTest.java:114)
	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:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165)
	at org.apache.maven.surefire.Surefire.run(Surefire.java:107)
	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:289)
	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:993)
Caused by: java.sql.SQLException: Unable to acquire a new connection from the pool
	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:120)
	at org.apache.commons.dbcp.managed.ManagedConnection.<init>(ManagedConnection.java:55)
	at org.apache.commons.dbcp.managed.ManagedDataSource.getConnection(ManagedDataSource.java:77)
	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:884)
	at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:106)
	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal(JDBCStoreManager.java:773)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:758)
	... 45 more
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:117)
	... 52 more



So, the JDBC connection is not released correctly. It might be related to OPENEJB-953.

Vincent

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENEJB-996) JDBC connection are not released correctly with intra VM Open EJB

Posted by "Vincent MATHON (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENEJB-996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671766#action_12671766 ] 

Vincent MATHON commented on OPENEJB-996:
----------------------------------------

The bug is related to logging. 

With OpenEJB 3.1:
If I use System.setProperty("openejb.logger.external", "true");  in the "setUp" method of my test case and the workaround for OPENEJB-950 bug, everything works fine (OPENEJB-950 workaround = <category name="Transaction"><priority value="ERROR" /></category>) although runs throwing the triggered exception are much slower than the other runs.

With OpenEJB 3.1.1-SNAPSHOT:
If I use System.setProperty("openejb.logger.external", "true"); without <category name="Transaction"><priority value="ERROR" /></category>, I do not have OPENEJB-950 bug but I still have a problem with my connections !
If I also use the <category name="Transaction"><priority value="ERROR" /></category>, everything works fine but runs throwing the triggered exception are much slower than the other runs too ????

So, OpenEJB transaction management seems to be strongly affected by logging.

sincerly
Vincent

> JDBC connection are not released correctly with intra VM Open EJB
> -----------------------------------------------------------------
>
>                 Key: OPENEJB-996
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-996
>             Project: OpenEJB
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: maven 2.0.9, EJB3, Windows 2000, Eclipse 3.4.1, Maven Integration For Eclipse 0.9.6
>            Reporter: Vincent MATHON
>         Attachments: OpenEJBBUG.zip
>
>
> I have built a Junit test case from The movies OpenEJB example.
> I have two SLSB with Required Tx. I have configured a pool with only 1 instance to obtain predictive behaviour.
> The first SLSB save an entity (a movie) without throwing exception whereas the second always throw a triggered exception after persisting the movie (this is an ApplicationException with rollback=true but I can reproduce the bug with a RuntimeException too).
> I can run five times (and more) the first SLSB without any problem. When I run twice the second SLSB I obtain the following exception:
> #########################################################################################
> ############################# WITHOUT EXCEPTION #########################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN ... #############################################
> ############################# THIRD RUN ... #############################################
> ############################# FOURTH RUN ... #############################################
> ############################# FIFTH RUN ... #############################################
> #########################################################################################
> ############################# WITH EXCEPTION ############################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN (Should Block) ... #############################
> WARN - Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.1.0-r422266:659716 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Unable to acquire a new connection from the pool
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4150)
> 	at org.apache.openjpa.jdbc.sql.HSQLDictionary.newStoreException(HSQLDictionary.java:292)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:762)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.retainConnection(JDBCStoreManager.java:201)
> 	at org.apache.openjpa.kernel.DelegatingStoreManager.retainConnection(DelegatingStoreManager.java:163)
> 	at org.apache.openjpa.kernel.BrokerImpl.retainConnection(BrokerImpl.java:3700)
> 	at org.apache.openjpa.kernel.BrokerImpl.beginStoreManagerTransaction(BrokerImpl.java:1280)
> 	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1965)
> 	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1905)
> 	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1823)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:515)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:500)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:473)
> 	at org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:258)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.rollbackTransaction(JtaTransactionPolicy.java:333)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.completeTransaction(JtaTransactionPolicy.java:283)
> 	at org.apache.openejb.core.transaction.TxRequired.commit(TxRequired.java:71)
> 	at org.apache.openejb.core.transaction.EjbTransactionUtil.afterInvoke(EjbTransactionUtil.java:74)
> 	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:231)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
> 	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
> 	at $Proxy23.addMovie(Unknown Source)
> 	at org.superbiz.injection.tx.MoviesTest.testConnectionUnreleasedCorrectlyWhenExceptionIsThrown(MoviesTest.java:114)
> 	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:168)
> 	at junit.framework.TestCase.runBare(TestCase.java:134)
> 	at junit.framework.TestResult$1.protect(TestResult.java:110)
> 	at junit.framework.TestResult.runProtected(TestResult.java:128)
> 	at junit.framework.TestResult.run(TestResult.java:113)
> 	at junit.framework.TestCase.run(TestCase.java:124)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:232)
> 	at junit.framework.TestSuite.run(TestSuite.java:227)
> 	at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
> 	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:107)
> 	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:289)
> 	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:993)
> Caused by: java.sql.SQLException: Unable to acquire a new connection from the pool
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:120)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.<init>(ManagedConnection.java:55)
> 	at org.apache.commons.dbcp.managed.ManagedDataSource.getConnection(ManagedDataSource.java:77)
> 	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:884)
> 	at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:106)
> 	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal(JDBCStoreManager.java:773)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:758)
> 	... 45 more
> Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
> 	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:117)
> 	... 52 more
> So, the JDBC connection is not released correctly. It might be related to OPENEJB-953.
> Vincent

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENEJB-996) JDBC connection are not released correctly with intra VM Open EJB

Posted by "Vincent MATHON (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENEJB-996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12670743#action_12670743 ] 

Vincent MATHON commented on OPENEJB-996:
----------------------------------------

I have found OpenEJB nightly buids 3.1.1-SNAPSHOT. (29/01/2009) in the maven repository http://people.apache.org/repo/m2-snapshot-repository.

I still reproduce the bug with this version (which includes OpenJPA 1.2.0).
Why do you think it is an OpenJPA related bug ? I couldn't find any interaction with OpenJPA during the rollback process (when the TrigerredException is thrown during the first run with exception).

> JDBC connection are not released correctly with intra VM Open EJB
> -----------------------------------------------------------------
>
>                 Key: OPENEJB-996
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-996
>             Project: OpenEJB
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: maven 2.0.9, EJB3, Windows 2000, Eclipse 3.4.1, Maven Integration For Eclipse 0.9.6
>            Reporter: Vincent MATHON
>         Attachments: OpenEJBBUG.zip
>
>
> I have built a Junit test case from The movies OpenEJB example.
> I have two SLSB with Required Tx. I have configured a pool with only 1 instance to obtain predictive behaviour.
> The first SLSB save an entity (a movie) without throwing exception whereas the second always throw a triggered exception after persisting the movie (this is an ApplicationException with rollback=true but I can reproduce the bug with a RuntimeException too).
> I can run five times (and more) the first SLSB without any problem. When I run twice the second SLSB I obtain the following exception:
> #########################################################################################
> ############################# WITHOUT EXCEPTION #########################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN ... #############################################
> ############################# THIRD RUN ... #############################################
> ############################# FOURTH RUN ... #############################################
> ############################# FIFTH RUN ... #############################################
> #########################################################################################
> ############################# WITH EXCEPTION ############################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN (Should Block) ... #############################
> WARN - Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.1.0-r422266:659716 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Unable to acquire a new connection from the pool
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4150)
> 	at org.apache.openjpa.jdbc.sql.HSQLDictionary.newStoreException(HSQLDictionary.java:292)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:762)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.retainConnection(JDBCStoreManager.java:201)
> 	at org.apache.openjpa.kernel.DelegatingStoreManager.retainConnection(DelegatingStoreManager.java:163)
> 	at org.apache.openjpa.kernel.BrokerImpl.retainConnection(BrokerImpl.java:3700)
> 	at org.apache.openjpa.kernel.BrokerImpl.beginStoreManagerTransaction(BrokerImpl.java:1280)
> 	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1965)
> 	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1905)
> 	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1823)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:515)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:500)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:473)
> 	at org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:258)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.rollbackTransaction(JtaTransactionPolicy.java:333)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.completeTransaction(JtaTransactionPolicy.java:283)
> 	at org.apache.openejb.core.transaction.TxRequired.commit(TxRequired.java:71)
> 	at org.apache.openejb.core.transaction.EjbTransactionUtil.afterInvoke(EjbTransactionUtil.java:74)
> 	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:231)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
> 	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
> 	at $Proxy23.addMovie(Unknown Source)
> 	at org.superbiz.injection.tx.MoviesTest.testConnectionUnreleasedCorrectlyWhenExceptionIsThrown(MoviesTest.java:114)
> 	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:168)
> 	at junit.framework.TestCase.runBare(TestCase.java:134)
> 	at junit.framework.TestResult$1.protect(TestResult.java:110)
> 	at junit.framework.TestResult.runProtected(TestResult.java:128)
> 	at junit.framework.TestResult.run(TestResult.java:113)
> 	at junit.framework.TestCase.run(TestCase.java:124)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:232)
> 	at junit.framework.TestSuite.run(TestSuite.java:227)
> 	at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
> 	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:107)
> 	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:289)
> 	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:993)
> Caused by: java.sql.SQLException: Unable to acquire a new connection from the pool
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:120)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.<init>(ManagedConnection.java:55)
> 	at org.apache.commons.dbcp.managed.ManagedDataSource.getConnection(ManagedDataSource.java:77)
> 	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:884)
> 	at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:106)
> 	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal(JDBCStoreManager.java:773)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:758)
> 	... 45 more
> Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
> 	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:117)
> 	... 52 more
> So, the JDBC connection is not released correctly. It might be related to OPENEJB-953.
> Vincent

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENEJB-996) JDBC connection are not released correctly with intra VM Open EJB

Posted by "Vincent MATHON (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENEJB-996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12670723#action_12670723 ] 

Vincent MATHON commented on OPENEJB-996:
----------------------------------------

Do you reproduce the anomaly with the latest OpenEJB nightly build ?

> JDBC connection are not released correctly with intra VM Open EJB
> -----------------------------------------------------------------
>
>                 Key: OPENEJB-996
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-996
>             Project: OpenEJB
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: maven 2.0.9, EJB3, Windows 2000, Eclipse 3.4.1, Maven Integration For Eclipse 0.9.6
>            Reporter: Vincent MATHON
>         Attachments: OpenEJBBUG.zip
>
>
> I have built a Junit test case from The movies OpenEJB example.
> I have two SLSB with Required Tx. I have configured a pool with only 1 instance to obtain predictive behaviour.
> The first SLSB save an entity (a movie) without throwing exception whereas the second always throw a triggered exception after persisting the movie (this is an ApplicationException with rollback=true but I can reproduce the bug with a RuntimeException too).
> I can run five times (and more) the first SLSB without any problem. When I run twice the second SLSB I obtain the following exception:
> #########################################################################################
> ############################# WITHOUT EXCEPTION #########################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN ... #############################################
> ############################# THIRD RUN ... #############################################
> ############################# FOURTH RUN ... #############################################
> ############################# FIFTH RUN ... #############################################
> #########################################################################################
> ############################# WITH EXCEPTION ############################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN (Should Block) ... #############################
> WARN - Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.1.0-r422266:659716 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Unable to acquire a new connection from the pool
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4150)
> 	at org.apache.openjpa.jdbc.sql.HSQLDictionary.newStoreException(HSQLDictionary.java:292)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:762)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.retainConnection(JDBCStoreManager.java:201)
> 	at org.apache.openjpa.kernel.DelegatingStoreManager.retainConnection(DelegatingStoreManager.java:163)
> 	at org.apache.openjpa.kernel.BrokerImpl.retainConnection(BrokerImpl.java:3700)
> 	at org.apache.openjpa.kernel.BrokerImpl.beginStoreManagerTransaction(BrokerImpl.java:1280)
> 	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1965)
> 	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1905)
> 	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1823)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:515)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:500)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:473)
> 	at org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:258)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.rollbackTransaction(JtaTransactionPolicy.java:333)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.completeTransaction(JtaTransactionPolicy.java:283)
> 	at org.apache.openejb.core.transaction.TxRequired.commit(TxRequired.java:71)
> 	at org.apache.openejb.core.transaction.EjbTransactionUtil.afterInvoke(EjbTransactionUtil.java:74)
> 	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:231)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
> 	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
> 	at $Proxy23.addMovie(Unknown Source)
> 	at org.superbiz.injection.tx.MoviesTest.testConnectionUnreleasedCorrectlyWhenExceptionIsThrown(MoviesTest.java:114)
> 	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:168)
> 	at junit.framework.TestCase.runBare(TestCase.java:134)
> 	at junit.framework.TestResult$1.protect(TestResult.java:110)
> 	at junit.framework.TestResult.runProtected(TestResult.java:128)
> 	at junit.framework.TestResult.run(TestResult.java:113)
> 	at junit.framework.TestCase.run(TestCase.java:124)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:232)
> 	at junit.framework.TestSuite.run(TestSuite.java:227)
> 	at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
> 	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:107)
> 	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:289)
> 	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:993)
> Caused by: java.sql.SQLException: Unable to acquire a new connection from the pool
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:120)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.<init>(ManagedConnection.java:55)
> 	at org.apache.commons.dbcp.managed.ManagedDataSource.getConnection(ManagedDataSource.java:77)
> 	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:884)
> 	at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:106)
> 	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal(JDBCStoreManager.java:773)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:758)
> 	... 45 more
> Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
> 	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:117)
> 	... 52 more
> So, the JDBC connection is not released correctly. It might be related to OPENEJB-953.
> Vincent

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENEJB-996) JDBC connection are not released correctly with intra VM Open EJB

Posted by "Jean-Louis MONTEIRO (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENEJB-996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795584#action_12795584 ] 

Jean-Louis MONTEIRO commented on OPENEJB-996:
---------------------------------------------

Vincent,

i did some more tests with your sample.
regardless the logging issue (OPENEJB-950) fixed in 3.1.1, there is no other OpenEJB related issue with connection leak.
Setting or not the property System.setProperty("openejb.logger.external", "true"); does not change anything except that when it's set to true, you are not able to see the exception.

By the way, when you say the test is too much slower, it's directly link with the DBCP parameter p.put("movieDatabase.MaxWait", 10000);
If you change the value to 20000, it gonna last more or less 20s.

IMHO, it's an OpenJPA issue which does not release the connection. I tried with Hibernate and it works fine.
You can achieve the same kind of behavior adding the property <property name="openjpa.ConnectionRetainMode" value="transaction"/> to your persistence.xml file.

Here is a link to the documentation.
http://openjpa.apache.org/builds/1.0.2/apache-openjpa-1.0.2/docs/manual/ref_guide_dbsetup_retain.html

Gonna send this issue to the OpenJPA user@list.




> JDBC connection are not released correctly with intra VM Open EJB
> -----------------------------------------------------------------
>
>                 Key: OPENEJB-996
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-996
>             Project: OpenEJB
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: maven 2.0.9, EJB3, Windows 2000, Eclipse 3.4.1, Maven Integration For Eclipse 0.9.6
>            Reporter: Vincent MATHON
>         Attachments: OpenEJBBUG.zip
>
>
> I have built a Junit test case from The movies OpenEJB example.
> I have two SLSB with Required Tx. I have configured a pool with only 1 instance to obtain predictive behaviour.
> The first SLSB save an entity (a movie) without throwing exception whereas the second always throw a triggered exception after persisting the movie (this is an ApplicationException with rollback=true but I can reproduce the bug with a RuntimeException too).
> I can run five times (and more) the first SLSB without any problem. When I run twice the second SLSB I obtain the following exception:
> #########################################################################################
> ############################# WITHOUT EXCEPTION #########################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN ... #############################################
> ############################# THIRD RUN ... #############################################
> ############################# FOURTH RUN ... #############################################
> ############################# FIFTH RUN ... #############################################
> #########################################################################################
> ############################# WITH EXCEPTION ############################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN (Should Block) ... #############################
> WARN - Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.1.0-r422266:659716 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Unable to acquire a new connection from the pool
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4150)
> 	at org.apache.openjpa.jdbc.sql.HSQLDictionary.newStoreException(HSQLDictionary.java:292)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:762)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.retainConnection(JDBCStoreManager.java:201)
> 	at org.apache.openjpa.kernel.DelegatingStoreManager.retainConnection(DelegatingStoreManager.java:163)
> 	at org.apache.openjpa.kernel.BrokerImpl.retainConnection(BrokerImpl.java:3700)
> 	at org.apache.openjpa.kernel.BrokerImpl.beginStoreManagerTransaction(BrokerImpl.java:1280)
> 	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1965)
> 	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1905)
> 	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1823)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:515)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:500)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:473)
> 	at org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:258)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.rollbackTransaction(JtaTransactionPolicy.java:333)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.completeTransaction(JtaTransactionPolicy.java:283)
> 	at org.apache.openejb.core.transaction.TxRequired.commit(TxRequired.java:71)
> 	at org.apache.openejb.core.transaction.EjbTransactionUtil.afterInvoke(EjbTransactionUtil.java:74)
> 	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:231)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
> 	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
> 	at $Proxy23.addMovie(Unknown Source)
> 	at org.superbiz.injection.tx.MoviesTest.testConnectionUnreleasedCorrectlyWhenExceptionIsThrown(MoviesTest.java:114)
> 	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:168)
> 	at junit.framework.TestCase.runBare(TestCase.java:134)
> 	at junit.framework.TestResult$1.protect(TestResult.java:110)
> 	at junit.framework.TestResult.runProtected(TestResult.java:128)
> 	at junit.framework.TestResult.run(TestResult.java:113)
> 	at junit.framework.TestCase.run(TestCase.java:124)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:232)
> 	at junit.framework.TestSuite.run(TestSuite.java:227)
> 	at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
> 	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:107)
> 	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:289)
> 	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:993)
> Caused by: java.sql.SQLException: Unable to acquire a new connection from the pool
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:120)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.<init>(ManagedConnection.java:55)
> 	at org.apache.commons.dbcp.managed.ManagedDataSource.getConnection(ManagedDataSource.java:77)
> 	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:884)
> 	at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:106)
> 	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal(JDBCStoreManager.java:773)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:758)
> 	... 45 more
> Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
> 	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:117)
> 	... 52 more
> So, the JDBC connection is not released correctly. It might be related to OPENEJB-953.
> Vincent

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENEJB-996) JDBC connection are not released correctly with intra VM Open EJB

Posted by "Jean-Louis MONTEIRO (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENEJB-996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12675393#action_12675393 ] 

Jean-Louis MONTEIRO commented on OPENEJB-996:
---------------------------------------------

Vincent,

I tested your sample with Hibernate and I worked fine that why I believed it was OpenJPA.
Now, I can reproduce this bug with Hibernate too, and you are right, it's strongly related to the log level.

But the bug is always there.

> JDBC connection are not released correctly with intra VM Open EJB
> -----------------------------------------------------------------
>
>                 Key: OPENEJB-996
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-996
>             Project: OpenEJB
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: maven 2.0.9, EJB3, Windows 2000, Eclipse 3.4.1, Maven Integration For Eclipse 0.9.6
>            Reporter: Vincent MATHON
>         Attachments: OpenEJBBUG.zip
>
>
> I have built a Junit test case from The movies OpenEJB example.
> I have two SLSB with Required Tx. I have configured a pool with only 1 instance to obtain predictive behaviour.
> The first SLSB save an entity (a movie) without throwing exception whereas the second always throw a triggered exception after persisting the movie (this is an ApplicationException with rollback=true but I can reproduce the bug with a RuntimeException too).
> I can run five times (and more) the first SLSB without any problem. When I run twice the second SLSB I obtain the following exception:
> #########################################################################################
> ############################# WITHOUT EXCEPTION #########################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN ... #############################################
> ############################# THIRD RUN ... #############################################
> ############################# FOURTH RUN ... #############################################
> ############################# FIFTH RUN ... #############################################
> #########################################################################################
> ############################# WITH EXCEPTION ############################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN (Should Block) ... #############################
> WARN - Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.1.0-r422266:659716 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Unable to acquire a new connection from the pool
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4150)
> 	at org.apache.openjpa.jdbc.sql.HSQLDictionary.newStoreException(HSQLDictionary.java:292)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:762)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.retainConnection(JDBCStoreManager.java:201)
> 	at org.apache.openjpa.kernel.DelegatingStoreManager.retainConnection(DelegatingStoreManager.java:163)
> 	at org.apache.openjpa.kernel.BrokerImpl.retainConnection(BrokerImpl.java:3700)
> 	at org.apache.openjpa.kernel.BrokerImpl.beginStoreManagerTransaction(BrokerImpl.java:1280)
> 	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1965)
> 	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1905)
> 	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1823)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:515)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:500)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:473)
> 	at org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:258)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.rollbackTransaction(JtaTransactionPolicy.java:333)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.completeTransaction(JtaTransactionPolicy.java:283)
> 	at org.apache.openejb.core.transaction.TxRequired.commit(TxRequired.java:71)
> 	at org.apache.openejb.core.transaction.EjbTransactionUtil.afterInvoke(EjbTransactionUtil.java:74)
> 	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:231)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
> 	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
> 	at $Proxy23.addMovie(Unknown Source)
> 	at org.superbiz.injection.tx.MoviesTest.testConnectionUnreleasedCorrectlyWhenExceptionIsThrown(MoviesTest.java:114)
> 	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:168)
> 	at junit.framework.TestCase.runBare(TestCase.java:134)
> 	at junit.framework.TestResult$1.protect(TestResult.java:110)
> 	at junit.framework.TestResult.runProtected(TestResult.java:128)
> 	at junit.framework.TestResult.run(TestResult.java:113)
> 	at junit.framework.TestCase.run(TestCase.java:124)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:232)
> 	at junit.framework.TestSuite.run(TestSuite.java:227)
> 	at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
> 	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:107)
> 	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:289)
> 	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:993)
> Caused by: java.sql.SQLException: Unable to acquire a new connection from the pool
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:120)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.<init>(ManagedConnection.java:55)
> 	at org.apache.commons.dbcp.managed.ManagedDataSource.getConnection(ManagedDataSource.java:77)
> 	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:884)
> 	at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:106)
> 	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal(JDBCStoreManager.java:773)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:758)
> 	... 45 more
> Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
> 	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:117)
> 	... 52 more
> So, the JDBC connection is not released correctly. It might be related to OPENEJB-953.
> Vincent

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENEJB-996) JDBC connection are not released correctly with intra VM Open EJB

Posted by "Vincent MATHON (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENEJB-996?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vincent MATHON updated OPENEJB-996:
-----------------------------------

    Attachment: OpenEJBBUG.zip

I have uploaded a maven 2 eclipse project that reproduces the bug.

> JDBC connection are not released correctly with intra VM Open EJB
> -----------------------------------------------------------------
>
>                 Key: OPENEJB-996
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-996
>             Project: OpenEJB
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: maven 2.0.9, EJB3, Windows 2000, Eclipse 3.4.1, Maven Integration For Eclipse 0.9.6
>            Reporter: Vincent MATHON
>         Attachments: OpenEJBBUG.zip
>
>
> I have built a Junit test case from The movies OpenEJB example.
> I have two SLSB with Required Tx. I have configured a pool with only 1 instance to obtain predictive behaviour.
> The first SLSB save an entity (a movie) without throwing exception whereas the second always throw a triggered exception after persisting the movie (this is an ApplicationException with rollback=true but I can reproduce the bug with a RuntimeException too).
> I can run five times (and more) the first SLSB without any problem. When I run twice the second SLSB I obtain the following exception:
> #########################################################################################
> ############################# WITHOUT EXCEPTION #########################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN ... #############################################
> ############################# THIRD RUN ... #############################################
> ############################# FOURTH RUN ... #############################################
> ############################# FIFTH RUN ... #############################################
> #########################################################################################
> ############################# WITH EXCEPTION ############################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN (Should Block) ... #############################
> WARN - Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.1.0-r422266:659716 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Unable to acquire a new connection from the pool
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4150)
> 	at org.apache.openjpa.jdbc.sql.HSQLDictionary.newStoreException(HSQLDictionary.java:292)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:762)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.retainConnection(JDBCStoreManager.java:201)
> 	at org.apache.openjpa.kernel.DelegatingStoreManager.retainConnection(DelegatingStoreManager.java:163)
> 	at org.apache.openjpa.kernel.BrokerImpl.retainConnection(BrokerImpl.java:3700)
> 	at org.apache.openjpa.kernel.BrokerImpl.beginStoreManagerTransaction(BrokerImpl.java:1280)
> 	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1965)
> 	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1905)
> 	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1823)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:515)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:500)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:473)
> 	at org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:258)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.rollbackTransaction(JtaTransactionPolicy.java:333)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.completeTransaction(JtaTransactionPolicy.java:283)
> 	at org.apache.openejb.core.transaction.TxRequired.commit(TxRequired.java:71)
> 	at org.apache.openejb.core.transaction.EjbTransactionUtil.afterInvoke(EjbTransactionUtil.java:74)
> 	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:231)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
> 	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
> 	at $Proxy23.addMovie(Unknown Source)
> 	at org.superbiz.injection.tx.MoviesTest.testConnectionUnreleasedCorrectlyWhenExceptionIsThrown(MoviesTest.java:114)
> 	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:168)
> 	at junit.framework.TestCase.runBare(TestCase.java:134)
> 	at junit.framework.TestResult$1.protect(TestResult.java:110)
> 	at junit.framework.TestResult.runProtected(TestResult.java:128)
> 	at junit.framework.TestResult.run(TestResult.java:113)
> 	at junit.framework.TestCase.run(TestCase.java:124)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:232)
> 	at junit.framework.TestSuite.run(TestSuite.java:227)
> 	at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
> 	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:107)
> 	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:289)
> 	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:993)
> Caused by: java.sql.SQLException: Unable to acquire a new connection from the pool
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:120)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.<init>(ManagedConnection.java:55)
> 	at org.apache.commons.dbcp.managed.ManagedDataSource.getConnection(ManagedDataSource.java:77)
> 	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:884)
> 	at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:106)
> 	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal(JDBCStoreManager.java:773)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:758)
> 	... 45 more
> Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
> 	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:117)
> 	... 52 more
> So, the JDBC connection is not released correctly. It might be related to OPENEJB-953.
> Vincent

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (OPENEJB-996) JDBC connection are not released correctly with intra VM Open EJB

Posted by "Jean-Louis MONTEIRO (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENEJB-996?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Louis MONTEIRO reassigned OPENEJB-996:
-------------------------------------------

    Assignee: Jean-Louis MONTEIRO

> JDBC connection are not released correctly with intra VM Open EJB
> -----------------------------------------------------------------
>
>                 Key: OPENEJB-996
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-996
>             Project: OpenEJB
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: maven 2.0.9, EJB3, Windows 2000, Eclipse 3.4.1, Maven Integration For Eclipse 0.9.6
>            Reporter: Vincent MATHON
>            Assignee: Jean-Louis MONTEIRO
>         Attachments: OpenEJBBUG.zip
>
>
> I have built a Junit test case from The movies OpenEJB example.
> I have two SLSB with Required Tx. I have configured a pool with only 1 instance to obtain predictive behaviour.
> The first SLSB save an entity (a movie) without throwing exception whereas the second always throw a triggered exception after persisting the movie (this is an ApplicationException with rollback=true but I can reproduce the bug with a RuntimeException too).
> I can run five times (and more) the first SLSB without any problem. When I run twice the second SLSB I obtain the following exception:
> #########################################################################################
> ############################# WITHOUT EXCEPTION #########################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN ... #############################################
> ############################# THIRD RUN ... #############################################
> ############################# FOURTH RUN ... #############################################
> ############################# FIFTH RUN ... #############################################
> #########################################################################################
> ############################# WITH EXCEPTION ############################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN (Should Block) ... #############################
> WARN - Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.1.0-r422266:659716 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Unable to acquire a new connection from the pool
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4150)
> 	at org.apache.openjpa.jdbc.sql.HSQLDictionary.newStoreException(HSQLDictionary.java:292)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:762)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.retainConnection(JDBCStoreManager.java:201)
> 	at org.apache.openjpa.kernel.DelegatingStoreManager.retainConnection(DelegatingStoreManager.java:163)
> 	at org.apache.openjpa.kernel.BrokerImpl.retainConnection(BrokerImpl.java:3700)
> 	at org.apache.openjpa.kernel.BrokerImpl.beginStoreManagerTransaction(BrokerImpl.java:1280)
> 	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1965)
> 	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1905)
> 	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1823)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:515)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:500)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:473)
> 	at org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:258)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.rollbackTransaction(JtaTransactionPolicy.java:333)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.completeTransaction(JtaTransactionPolicy.java:283)
> 	at org.apache.openejb.core.transaction.TxRequired.commit(TxRequired.java:71)
> 	at org.apache.openejb.core.transaction.EjbTransactionUtil.afterInvoke(EjbTransactionUtil.java:74)
> 	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:231)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
> 	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
> 	at $Proxy23.addMovie(Unknown Source)
> 	at org.superbiz.injection.tx.MoviesTest.testConnectionUnreleasedCorrectlyWhenExceptionIsThrown(MoviesTest.java:114)
> 	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:168)
> 	at junit.framework.TestCase.runBare(TestCase.java:134)
> 	at junit.framework.TestResult$1.protect(TestResult.java:110)
> 	at junit.framework.TestResult.runProtected(TestResult.java:128)
> 	at junit.framework.TestResult.run(TestResult.java:113)
> 	at junit.framework.TestCase.run(TestCase.java:124)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:232)
> 	at junit.framework.TestSuite.run(TestSuite.java:227)
> 	at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
> 	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:107)
> 	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:289)
> 	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:993)
> Caused by: java.sql.SQLException: Unable to acquire a new connection from the pool
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:120)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.<init>(ManagedConnection.java:55)
> 	at org.apache.commons.dbcp.managed.ManagedDataSource.getConnection(ManagedDataSource.java:77)
> 	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:884)
> 	at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:106)
> 	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal(JDBCStoreManager.java:773)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:758)
> 	... 45 more
> Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
> 	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:117)
> 	... 52 more
> So, the JDBC connection is not released correctly. It might be related to OPENEJB-953.
> Vincent

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENEJB-996) JDBC connection are not released correctly with intra VM Open EJB

Posted by "Jean-Louis MONTEIRO (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENEJB-996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12669590#action_12669590 ] 

Jean-Louis MONTEIRO commented on OPENEJB-996:
---------------------------------------------

I had a look on that point and it seems to me it is an OpenJPA related bug.


> JDBC connection are not released correctly with intra VM Open EJB
> -----------------------------------------------------------------
>
>                 Key: OPENEJB-996
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-996
>             Project: OpenEJB
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: maven 2.0.9, EJB3, Windows 2000, Eclipse 3.4.1, Maven Integration For Eclipse 0.9.6
>            Reporter: Vincent MATHON
>         Attachments: OpenEJBBUG.zip
>
>
> I have built a Junit test case from The movies OpenEJB example.
> I have two SLSB with Required Tx. I have configured a pool with only 1 instance to obtain predictive behaviour.
> The first SLSB save an entity (a movie) without throwing exception whereas the second always throw a triggered exception after persisting the movie (this is an ApplicationException with rollback=true but I can reproduce the bug with a RuntimeException too).
> I can run five times (and more) the first SLSB without any problem. When I run twice the second SLSB I obtain the following exception:
> #########################################################################################
> ############################# WITHOUT EXCEPTION #########################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN ... #############################################
> ############################# THIRD RUN ... #############################################
> ############################# FOURTH RUN ... #############################################
> ############################# FIFTH RUN ... #############################################
> #########################################################################################
> ############################# WITH EXCEPTION ############################################
> #########################################################################################
> ############################# FIRST RUN ... #############################################
> ############################# SECOND RUN (Should Block) ... #############################
> WARN - Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.1.0-r422266:659716 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Unable to acquire a new connection from the pool
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.narrow(SQLExceptions.java:146)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4150)
> 	at org.apache.openjpa.jdbc.sql.HSQLDictionary.newStoreException(HSQLDictionary.java:292)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:762)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.retainConnection(JDBCStoreManager.java:201)
> 	at org.apache.openjpa.kernel.DelegatingStoreManager.retainConnection(DelegatingStoreManager.java:163)
> 	at org.apache.openjpa.kernel.BrokerImpl.retainConnection(BrokerImpl.java:3700)
> 	at org.apache.openjpa.kernel.BrokerImpl.beginStoreManagerTransaction(BrokerImpl.java:1280)
> 	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1965)
> 	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1905)
> 	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1823)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:515)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:500)
> 	at org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:473)
> 	at org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:258)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.rollbackTransaction(JtaTransactionPolicy.java:333)
> 	at org.apache.openejb.core.transaction.JtaTransactionPolicy.completeTransaction(JtaTransactionPolicy.java:283)
> 	at org.apache.openejb.core.transaction.TxRequired.commit(TxRequired.java:71)
> 	at org.apache.openejb.core.transaction.EjbTransactionUtil.afterInvoke(EjbTransactionUtil.java:74)
> 	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:231)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
> 	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
> 	at $Proxy23.addMovie(Unknown Source)
> 	at org.superbiz.injection.tx.MoviesTest.testConnectionUnreleasedCorrectlyWhenExceptionIsThrown(MoviesTest.java:114)
> 	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:168)
> 	at junit.framework.TestCase.runBare(TestCase.java:134)
> 	at junit.framework.TestResult$1.protect(TestResult.java:110)
> 	at junit.framework.TestResult.runProtected(TestResult.java:128)
> 	at junit.framework.TestResult.run(TestResult.java:113)
> 	at junit.framework.TestCase.run(TestCase.java:124)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:232)
> 	at junit.framework.TestSuite.run(TestSuite.java:227)
> 	at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
> 	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:107)
> 	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:289)
> 	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:993)
> Caused by: java.sql.SQLException: Unable to acquire a new connection from the pool
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:120)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.<init>(ManagedConnection.java:55)
> 	at org.apache.commons.dbcp.managed.ManagedDataSource.getConnection(ManagedDataSource.java:77)
> 	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:884)
> 	at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:106)
> 	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal(JDBCStoreManager.java:773)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:758)
> 	... 45 more
> Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
> 	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
> 	at org.apache.commons.dbcp.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:117)
> 	... 52 more
> So, the JDBC connection is not released correctly. It might be related to OPENEJB-953.
> Vincent

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.