Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

C3P0 Connections are not released on undeply

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic