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
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
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):
unreturnedConnectionTimeout
(set it to a value greater than 0
)debugUnreturnedConnectionStackTraces
(set it to true
)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.