The DBA at my company has a script that automatically kills long-running database connections and queries on our production databases. I\'ve written a CakePHP Shell application
Maybe you can manually connect/disconnect when you need to?
DboSource has lots of methods for you to play with. Here's a list of functions that may be useful:
$db = ConnectionManager::getDataSource('local');
$isconnected = $db->isConnected(); //is the connection open?
$db->close(); //close the connection
$db->reconnect(); //reconnect to the db
More methods are listed in the DboSource API docs