*
The moose likes JBoss/WildFly and the fly likes C3P0 Connections are not released on undeply Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "C3P0 Connections are not released on undeply" Watch "C3P0 Connections are not released on undeply" New topic
Author

C3P0 Connections are not released on undeply

Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 118
Hi All,

I am using c3p0 with the hibernate for connection pooling ,

I have noticed that when i undeploy the application the database connections are not released , to release them i need to restart the application server which is jboss 7

here is my C3P0 configuration




my pom file contains




Are my settings are right ? is there any property to release the created database connections , is C3P0 the best choice to manage the connection pool ?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9947
    
161

How are you testing that the connections aren't released?

The file you posted looks like a hibernate configuration file. Is that right? If yes, how are you using Hibernate in your application? Are you setting up the entitymanagers yourself?

[My Blog] [JavaRanch Journal]
Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 118
Hi Pai , Thanks for your reply ,

How are you testing that the connections aren't released?

By listing the number of database connections using the mysql command
show processlist;

executing this command after deploying of the application( and running it ) and after undeploy of the application


The file you posted looks like a hibernate configuration file. Is that right? If yes, how are you using Hibernate in your application?

yes it is hibernate configuration file along with C3P0 configuration ,

part of Hibernate configuration file :



I am using hibernate as the following

Hibernateutil class



Example to save entity




Are you setting up the entitymanagers yourself

Frankly i dont know what do you mean by entitymanagers , but i ll check that
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: C3P0 Connections are not released on undeply
 
Similar Threads
java.util.MissingResourceException: Can't find bundle for base name in JSF Spring Maven project
java.lang.AbstractMethodError
whats wrong with my spring 3.x + hibernate 4.x + maven configuration
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile error
HTTP Status 404 - Servlet appServlet is not available