I am having an Spring MVC + Mysql (JDBC 4) + c3p0 0.9.2 project.
In c3p0 maxIdleTime value is 240 (i.e 4 mins.) and wait_timeout in my.ini
unused connection means the connection which are in sleep state according to mysql(?)
According to mysql, this simply means that a connection was established with mysql/db, but there has been no activity here for the past amount of time and due to configuration / settings of mysql(which can be changed), the connection was destroyed.
What is interactive and noninteractive connections? Interactive connections are when your input hardware(keyboard) interacts using command line with mysql. In short where you write the queries
Non interactive or rather wait_timeout queries are those for which your code establishes connection with mysql.
Is unused connections and noninteractive coonections are same? because my DBA set wait_timeout to 30 seconds (he come to this value by observing DB server so that very less amount of connections be in sleep mode) this means an connection can be in sleep mode for 30 seconds after that it will be closed but at the otherhand c3p0's maxIdleTime is set to 240 seconds so whats this maxIdleTime setting playing role in this case.
MaxIdleTime is done by your code at hibernateJpa Configuration where you ask your code itself to close a hibernate connection(for example) after a connection is unused. You have ownership of this as a coder.
Wait_timeout on other hand is from mysql side. So it is upon the DB administrator to set it up and change.
What is interactive_timeout?
Again, interactive timeout is when you are writing queries after connecting to mysql from keyboard on command line and that time conf in mysql gets up.
If you want to know more about how to change these values, go through this link: http://www.serveridol.com/2012/04/13/mysql-interactive_timeout-vs-wait_timeout/
Hope now it is clear to you.:)