As the author of the BoneCP wrote here, there are 2 ways to manage connections state - the way you use and just setting maxConnectionAgeInSeconds.
Important note - don't forget about MySQL configuration such as wait_timeout. It given in seconds and must be greater than maxConnectionAgeInSeconds. You can change this parameter in my.ini file in MySQL's directory.
For example, my current configuration:
wait_timeout=3600 (MySQL parameter);
maxConnectionAgeInSeconds=3000 (BoneCP parameter)
Also, I set interactive_timeout variable the same with wait_timeout. I'm not sure does it make sense but I saw somewhere MySQL takes min(interactive_timeout,wait_timeout). Actually, interactive_timeout is timeout for interactive clients - when you use MySQL command line you are interactive client. Anyway, it's better to make them equal - even this parameter doesn't make sense it's something like insurance.
P.S. Don't forget turn off mysql (cmd->net stop mysql) before setting variables. After setting new values check them in command line using show variables like '%timeout%';