Hello. I am having a connection problem with MySQL. I did a search but got over 8000 results.
My hibernate.cfg.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property> <property name="hibernate.connection.password">********</property> <property name="hibernate.connection.url">jdbc:mysql://dmzhost/ebl_price_catalog</property> <property name="hibernate.connection.username">webservice</property> <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> <property name="hibernate.c3p0.min_size">1</property> <property name="hibernate.c3p0.max_size">5</property> <property name="hibernate.c3p0.timeout">300</property> <property name="hibernate.c3p0.max_statements">50</property> <property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property> <mapping file="ediload.hbm.xml"/> </session-factory> </hibernate-configuration>
When I call buildSessionFactory, I get a stack trace from c3p0 that tells me its connection attempt failed and asks me if I have a server running at dmzhost:3306.
I am able to connect to MySQL from the command line:
mysql -h dmzhost -u webservice -D ebl_price_catalog -p
The host, dmzhost, is locally defined in /etc/hosts
Any ideas?
*** UPDATE ***
I noticed I am getting these errors:
WARNING: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@175b7f9 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! Dec 1, 2009 9:35:55 PM com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector run WARNING: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@175b7f9 -- APPARENT DEADLOCK!!! Complete Status: Managed Threads: 3 Active Threads: 3 Active Tasks: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@3bc1a1 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0) com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@12549c4 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1) com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@10df4e2 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2) Pending Tasks: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1485542 Pool thread stack traces: Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main] java.lang.Thread.sleep(Native Method) com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1805) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main] java.lang.Thread.sleep(Native Method) com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1805) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main] java.lang.Thread.sleep(Native Method) com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1805) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
I googled the deadlock problem, but all the hits seemed to be related to processes that were already running and performing queries. I tried setting the max_statements property to 0 with no change in symptoms.
Help?
|