title: liferay c3p0 apparent deadlock! on HSQL
body: <p>After compiling the source code of liferay 6.0.6 and deploy them to jboss 5.1.0 GA, I got the following error when I started the jboss.</p>
  
  <pre><code>2012-07-04 03:47:11,847 INFO  [com.liferay.portal.spring.hibernate.DialectDetector] (main) Using dialect org.hibernate.dialect.HSQLDialect
  2012-07-04 03:48:31,054 WARN  [com.mchange.v2.async.ThreadPoolAsynchronousRunner] (Timer-1) com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@1aee7e -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!
  2012-07-04 03:48:31,093 WARN  [com.mchange.v2.async.ThreadPoolAsynchronousRunner] (Timer-1) com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@1aee7e -- APPARENT DEADLOCK!!! Complete Status: 
      Managed Threads: 3
      Active Threads: 3
      Active Tasks: 
          com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@1b2eecb (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0)
          com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@5b66d0 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2)
          com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@baf34f (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1)
      Pending Tasks: 
          com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@1bbd74c
          com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@133c07e
          com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@a2a139
          com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@106cc7d
          com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@15b47ff
          com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@1d3e63b
          com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@b035a8
  Pool thread stack traces:
      Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,jboss]
          org.hsqldb.jdbc.jdbcDatabaseMetaData.getTables(Unknown Source)
          com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnectionNoQuery(DefaultConnectionTester.java:185)
          com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:62)
          com.mchange.v2.c3p0.AbstractConnectionTester.activeCheckConnection(AbstractConnectionTester.java:67)
          com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:368)
          com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishIdleResource(C3P0PooledConnectionPool.java:310)
          com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask.run(BasicResourcePool.java:1999)
          com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
      Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,jboss]
          org.hsqldb.jdbc.jdbcDatabaseMetaData.getTables(Unknown Source)
          com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnectionNoQuery(DefaultConnectionTester.java:185)
          com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:62)
          com.mchange.v2.c3p0.AbstractConnectionTester.activeCheckConnection(AbstractConnectionTester.java:67)
          com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:368)
          com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishIdleResource(C3P0PooledConnectionPool.java:310)
          com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask.run(BasicResourcePool.java:1999)
          com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
      Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,jboss]
          org.hsqldb.jdbc.jdbcDatabaseMetaData.getTables(Unknown Source)
          com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnectionNoQuery(DefaultConnectionTester.java:185)
          com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:62)
          com.mchange.v2.c3p0.AbstractConnectionTester.activeCheckConnection(AbstractConnectionTester.java:67)
          com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:368)
          com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishIdleResource(C3P0PooledConnectionPool.java:310)
          com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask.run(BasicResourcePool.java:1999)
          com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
  
      2012-07-04 03:49:31,104 WARN  [com.mchange.v2.async.ThreadPoolAsynchronousRunner] (Timer-1) Task com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@1b2eecb (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
      2012-07-04 03:49:31,104 WARN  [com.mchange.v2.async.ThreadPoolAsynchronousRunner] (Timer-1) Task com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@5b66d0 (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
      2012-07-04 03:49:31,104 WARN  [com.mchange.v2.async.ThreadPoolAsynchronousRunner] (Timer-1) Task com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@baf34f (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
  </code></pre>
  
  <p>I googled on the web and got to know that it is related to a c3p0 issue. see <a href="https://forum.hibernate.org/viewtopic.php?p=2386237" rel="nofollow">this link</a> and <a href="https://forum.hibernate.org/viewtopic.php?t=947246&amp;start=0&amp;postdays=0&amp;postorder=asc&amp;highlight=apparent%20deadlock%20c3p0&amp;sid=" rel="nofollow">this</a>. I follow the instructions and try to make the configuration changes in <code>$LIFERAY_HOME/portal-ext.properties</code>  </p>
  
  <pre><code>hibernate.c3p0.max_statements=0
  </code></pre>
  
  <p>or</p>
  
  <pre><code> jdbc.default.acquireIncrement=5
   jdbc.default.maxPoolSize=100
   jdbc.default.minPoolSize=10
   jdbc.default.numHelperThreads=10
  </code></pre>
  
  <p>but it didn't work. </p>
  
  <p>Any suggestion ? 
  Thanks </p>