-->
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.  [ 1 post ] 
Author Message
 Post subject: Sudden database connection problem
PostPosted: Mon Sep 29, 2008 10:01 am 
Newbie

Joined: Fri Jun 13, 2008 4:52 pm
Posts: 9
Location: Västerås, Sweden
Dear Hibernate users,

I've got a really weird Hibernate problem and I'm hoping that one of you has any ideas on how I could solve it.

I'm using Hibernate 3.2.6, MySQL Server 5.0.51a and Sun Java System Application Server 9.1.01 with NetBeans 5.5.1

The problem is that I can't connect to the database. When I try to do any kind of database operation I get these exceptions:
Code:
org.hibernate.exception.GenericJDBCException: Cannot open connection
....
java.sql.SQLException: Connections could not be acquired from the underlying database!
....
com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.


I can also add that this is a web application, that I'm using hbm.xml files and c3p0 as connection pool.

What's weird about this problem is that everything has worked earlier and since then I haven't changed a single thing in the application!

What I have done is worked on another Hibernate application (not web but Java desktop app.) which uses another database with the same MySQL Server and the same NetBeans version. In this application I tried to autogenerate the database tables from the hbm.xml files using hbm2ddl, which didn't work. Only 2 out of 4 tables were generated and I couldn't see anything wrong with the mapping files. (It was possible, though, to save objects to the tables that were generated.)

I'm thinking that the problems with the web application might have something to do with the database generation I tried to do with the desktop application. I know this sounds really strange but I can't find any other way of explaining it.

Anyway, the question is what I can do to make it work again. I would really appreciate any kind of advice on this matter.

Thanks in advance!

Best regards
Ylva


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

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.