How to make the MySQL Database always available during use the PHP Interactive Shell?
I have the problem that I connect to DB at the beginning and it timeout in shortly. System Admin set the timeout of MySQL database to 10 seconds (idle) and I am not be able to change that value. However this value is not long enough to interactive with Propel object with the shell in time. I look for the way without change the configuration at MySQL server.
For example
// Assume that User is the Propel class
$con = User::create();
$first = $con->findPk(2); // Still alive
sleep(11);
$second = $con->findPk(1); // Dead -- Return NULL
Details of MySQL variable (note that I am not allow to change those variable)
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| connect_timeout | 10 |
| delayed_insert_timeout | 300 |
| innodb_lock_wait_timeout | 360 |
| innodb_rollback_on_timeout | OFF |
| interactive_timeout | 28800 |
| net_read_timeout | 30 |
| net_write_timeout | 60 |
| slave_net_timeout | 3600 |
| table_lock_wait_timeout | 50 |
| wait_timeout | 28800 |
+----------------------------+-------+