[Dbix-class] Reconnecting Behavior

Adam Herzog adam at herzogdesigns.com
Thu Jul 26 15:50:02 GMT 2007


I'm having trouble with reconnecting to the db, and I'm not sure if  
it's expected behavior or not.

Essentially, I have a cat/dbic app and mysql database. For reasons  
beyond my control, the mysql db is periodically shutdown for brief  
periods of time. If no requests are made during the downtime, then  
the first request after the db becomes available again reconnects to  
the db and everything works great.

If a request comes in while the database is down, dbic tries to  
reconnect and fails (of course). But, further requests don't try and  
connect to the db anymore after the initial failure. So, once the  
database IS available again, dbic isn't reconnecting anymore, just  
failing (with "Can't call method "prepare_cached" on unblessed  
reference at /Library/Perl/5.8.6/DBIx/Class/Storage/DBI.pm line 1086.")

So... is this a bug, where dbic should be trying to reconnect after  
the initial failure? Or, is that expected behavior for some reason?

Any suggestions on what I can do, either to help update DBIC, or to  
handle the situation in my own code?

Thanks,

-A



More information about the Dbix-class mailing list