4 Replies Latest reply: May 30, 2012 4:05 AM by Galder Zamarreño RSS

Eviction process don't release connections from pool in 5.1.3CR1?

Juan Ignacio Barisich Newbie

Hi everybody.

We have a web application with ISPN in embedded mode. With ISPN 5.0.1.FINAL all works ok. But recently, have migrated ISPN to 5.1.3CR1 and we are experiencing problems. Basically, the aplicaction throws exceptions like:

 

2012-03-29 16:12:28,553 ERROR ISPN000045: Problems encountered while purging expired

org.infinispan.loaders.CacheLoaderException: This might be related to https://jira.jboss.org/browse/ISPN-604

    at org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory.getConnection(ManagedConnectionFactory.java:93)

    at org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.purgeInternal(JdbcStringBasedCacheStore.java:318)

    at org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStore.purgeInternal(JdbcMixedCacheStore.java:130)

    at org.infinispan.loaders.AbstractCacheStore$2.run(AbstractCacheStore.java:106)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:898)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:920)

    at java.lang.Thread.run(Thread.java:736)

Caused by:

org.jboss.util.NestedSQLException: No ManagedConnections available within configured blocking timeout ( 30000 ); - nested throwable: (javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 ))

    at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:96)

    at org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory.getConnection(ManagedConnectionFactory.java:90)

    ... 6 more

Caused by:

javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 )

    at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:301)

    at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:500)

    at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:348)

    at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:330)

    at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:423)

    at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:850)

    at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:90)

    at org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory.getConnection(ManagedConnectionFactory.java:94)

    ... 6 more

 

 

Apparently, the eviction process in not releasing the connections from the connections pool (managed by the application server) .

The solution for avoid this exceptions is to disable the eviction, by adding the following tag to the ispn configuration file:

 

 

 

 

Are we doing something wrong or is this is a bug?

There is the configuration we are using:

 

db2-jcc-xa-ds.xml

 

 

 

infinispan.xml:

 

 

Thanks

  • 2. Re: Eviction process don't release connections from pool in 5.1.3CR1?
    Juan Ignacio Barisich Newbie

    Galder, thanks for replying

    I made these changes, but 4 tests fail (errors are bellow).

    I tried some alternatives with no success.

     

    Have you any other suggestions?

     

    Thanks

     

    -------------------------------------------------------------------------------------------------------------

    loaders.jdbc.mixed.JdbcMixedCacheStoreTest

    Tests passed/Failed/Skipped:    5/2/0

    Started on:    Mon May 28 14:22:45 ART 2012

    Total time:    9 seconds (9068 ms)

    Included groups:   

    Excluded groups:   

     

    (Hover the method name to see the test class name)

     

    FAILED TESTS

    Test method     Exception     Time (seconds)     Instance

    testPurgeExpired

    Test class: org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest    

     

    java.lang.AssertionError: Expected 0 rows, actual value is 1

        at org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest.assertBinaryRowCount(JdbcMixedCacheStoreTest.java:221)

        at org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest.assertRowCounts(JdbcMixedCacheStoreTest.java:204)

        at org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest.testPurgeExpired(JdbcMixedCacheStoreTest.java:185)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

        at java.lang.Thread.run(Thread.java:662)

    ... Removed 17 stack frames

     

    Click to show all stack frames     1     org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest@6286e3

    testPurgeExpiredWithRemainingEntries

    Test class: org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest    

     

    java.lang.AssertionError: Expected 1 rows, actual value is 2

        at org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest.assertBinaryRowCount(JdbcMixedCacheStoreTest.java:221)

        at org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest.assertRowCounts(JdbcMixedCacheStoreTest.java:204)

        at org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest.testPurgeExpiredWithRemainingEntries(JdbcMixedCacheStoreTest.java:200)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

        at java.lang.Thread.run(Thread.java:662)

    ... Removed 17 stack frames

     

    1     org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest@6286e3

    -------------------------------------------------------------------------------------------------------------

    loaders.jdbc.mixed.JdbcMixedCacheStoreVamTest

    Tests passed/Failed/Skipped:    5/2/0

    Started on:    Mon May 28 14:22:45 ART 2012

    Total time:    9 seconds (9445 ms)

    Included groups:   

    Excluded groups:   

     

    (Hover the method name to see the test class name)

     

    FAILED TESTS

    Test method     Exception     Time (seconds)     Instance

    testPurgeExpired

    Test class: org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreVamTest    

     

    java.lang.AssertionError: Expected 0 rows, actual value is 1

        at org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest.assertBinaryRowCount(JdbcMixedCacheStoreTest.java:221)

        at org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest.assertRowCounts(JdbcMixedCacheStoreTest.java:204)

        at org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest.testPurgeExpired(JdbcMixedCacheStoreTest.java:185)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

        at java.lang.Thread.run(Thread.java:662)

    ... Removed 17 stack frames

     

    Click to show all stack frames     1     org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreVamTest@31028a

    testPurgeExpiredWithRemainingEntries

    Test class: org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreVamTest    

     

    java.lang.AssertionError: Expected 1 rows, actual value is 2

        at org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest.assertBinaryRowCount(JdbcMixedCacheStoreTest.java:221)

        at org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest.assertRowCounts(JdbcMixedCacheStoreTest.java:204)

        at org.infinispan.loaders.jdbc.mixed.JdbcMixedCacheStoreTest.testPurgeExpiredWithRemainingEntries(JdbcMixedCacheStoreTest.java:200)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

        at java.lang.Thread.run(Thread.java:662)

    ... Removed 17 stack frames


  • 3. Re: Eviction process don't release connections from pool in 5.1.3CR1?
    Galder Zamarreño Master

    You're right, my suggestion won't work as expected. I've tried to look for some leaks and might have found couple of them.

     

    Can you try building the following branch and use the resulting jars? you'd need core and cachestore/jdbc jars at the bare minimum.

     

    If the issue still present, can you provide a test case to replicate your original issue?