Hi All,

This question pertains to MySQL used with Symfony 1.0 and Propel.

I have a LONG running batch script that intermittently needs access to  
MySQL. I begin the script with the lines:

///code
$databaseManager = new sfDatabaseManager();
$databaseManager->initialize();
code////

And the program goes into an event loop, using FAM as the notifier.  
But, if lots of time elapses between the time I initialize and the  
time I need the connection, I get an error about MySQL has gone away.  
This means that the idle timeout was exceeded for MySQL. I know I  
could just set the timeouts to forever, but that is not a tenable  
solution.

The question is: how to I tell Symfony to reconnect to MySQL? Is the  
solution to use something like Propel::getConnection() every time I  
need it? Some other solution? As I mentioned, this script basically  
runs 24/7, only waking up when it needs to do something. As such,  
doing something like upping the MySQL timeout isn't really an option  
for me.

I've tried doing stuff like:

///code
$databaseManager = new sfDatabaseManager();
$databaseManager->initialize();

{do some stuff}

$databaseManager->shutdown();

{wait}

$databaseManager = new sfDatabaseManager();
$databaseManager->initialize();
///code

But that doesn't really work. Any tips anyone?

All Best,

JLS


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to