-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: MySQL Connection Problems
PostPosted: Tue Dec 01, 2009 3:34 pm 
Newbie

Joined: Tue Dec 01, 2009 2:41 pm
Posts: 4
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?


Top
 Profile  
 
 Post subject: Re: MySQL Connection Problems
PostPosted: Wed Dec 09, 2009 5:29 pm 
Newbie

Joined: Tue Dec 01, 2009 2:41 pm
Posts: 4
The problem here seems to be with the org.gjt.mm.mysql.Driver class. I switched to the MySQL JDBC connector class (provided by MySQL) and all connections are working. I don't have time to dig into this, so I'll leave it at that.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.