1

I am using org.apache.commons.dbcp.BasicDataSource and I want to monitor the UNCLOSED connections. What properties i have to set in hibernate config file?

Thanks. Giovanni

2 Answers2

1

It might be helpful to update your log4j configuration so the c3p0 config is printed to your log file. Just set category com.mchange.v2.c3p0 to "info". I'm having great difficulty getting my c3p0 configuration file to be picked up, so maybe yours isn't being read either.

Elroid
  • 456
  • 4
  • 11
0

I am not sure this is something supported by DBCP (if it is, maybe add a link to the documentation).

However, it should be possible using C3P0 and the following properties (see this previous answer):

You'll have to set them in the c3p0.propeties (see Appendix C: Hibernate-specific notes).

Another option would be to use BoneCP.

But I wonder why you need this, I'm pretty sure Hibernate is not leaking connections.

Community
  • 1
  • 1
Pascal Thivent
  • 535,937
  • 127
  • 1,027
  • 1,106
  • I want found the connection that programmers didn't close. I am using C3P0 now and I have setted the two properties but it doesn't write anything! – Giovanni R. Oct 20 '10 at 12:37
  • Sorry. I put the snippet of applicationContext.xml of Spring of connection parameters: .... I hope it logs the connections not closed by programmers but it doesn't it. – Giovanni R. Oct 20 '10 at 13:43