This is driving me crazy. Especially since I cannot seem to find any info about the problem on Google.
Here is the deal, I have set up Hibernate and as long as I use its built in JDBC connection pooling, everything works fine. However, as soon as I try and use c3p0, nothing works. I have a JUnittest class that tests my PersistenceDAO against a live MySQL 4.x database. Basically, it tries to insert, update, delete a bunch of objects to make sure that Hibernate is working correctly. This works fine, all tests pass, if I don't use c3p0. As soon as I turn it on, not a single test passes. I have no idea what is going on here. In an attempt to answer as many questions as possible, please see below:
IDE: NetBeans 5.0
Hibernate: version 3.1 using the library version that come bundled with it. c3p0: version c3p0-0.9.0.jar (I have tried the latest version as well,didn't work) MySQL: version 4.1.20 running on CentOS 4.3 JDBC: mysql-connector-java-3.1.12-bin.jar
Below are my hibernate config file and, as far as I can tell, the important parts from the stack trace. As you can see from the config file, I am using what is more or less a default use of c3p0, but nothing is working. Below everything, I have also included the source code from one of the methods from my PersistenceDao class in case the problem is in the code.
Thanks for the help with this, Chris
hibernate.cfg.xml
The stacktrace
PersistenceDao method
[ July 03, 2006: Message edited by: Chris Johnston ] [ July 03, 2006: Message edited by: Chris Johnston ]
I seemed to have fixed the problem, but I don't really understand how. I commented out the following statement in my hibernate.cfg file and the tests passed
I don't understand why that would make such a big difference. Can someone explain this please?
ravi bhosale
Greenhorn
Joined: Jun 17, 2006
Posts: 5
posted
0
Hi,
Me to also faced problem with Hibernate 3.1.2 and c3po. Finally its solved by building source of c3p0-0.9.0.2.
For me problem is because of different log4j version used by Hibernate and C3po. But now its working.
Nobody Cares
Greenhorn
Joined: Aug 16, 2006
Posts: 1
posted
0
I am experiencing exactly the same issue...has anyone resolved this issue since the initial post?
Bear Bibeault
Author and opinionated walrus
Marshal