Java – use ‘debugunreturnedconnectionstacktraces’ to debug connection loss
I am trying to solve the connection timeout problem of my ongoing project We use c3p0 to manage connection pool and Hibernate as ORM tool We also use spring
To find out if there are any unreturned connections, I have set debugunreturnedconnectionstacktraces to true in my c3p0 configuration (not in the c3p0 property)
Is there anything else I need to do Do I have to ask lod4j Properties add anything, or just set debugunreturnedconnectionstacktraces to true?
Also, should I set debugunreturnedconnectionstacktraces to true in the c3p0 attribute?
Thank you for your help
Solution
Extended Corey's answer:
If unreturnadconnectiontimeout is positive and debugunreturnedconnectionstacktraces is set to true, the logger "com.mchange.v2.resourcepool.basicresourcepool" will record and generate stack traces that do not return exceptions at the info level
Usually people will record anything above info level from all recorders, so these stack traces will only appear in your log However, if you do not see them, check your logging configuration to ensure that info messages from the logger are not filtered
Note that if unreturnadconnectiontimeout is not set, debugunreturnedconnectionstacktraces will perform noting
notice
http://www.mchange.com/projects/c3p0/#unreturnedConnectionTimeout
http://www.mchange.com/projects/c3p0/#debugUnreturnedConnectionStackTraces
I hope it helps!
Attachment: as long as the settings are correct, it doesn't matter how to set these properties C3p0 dumps the info pool configuration when the pool is started; Check your log to make sure you get the expected configuration whether you try to set parameters or not Alternatively, you can use JMX to check parameters