Hey guys... Sometimes I'm getting erros like this on my logs:
2010-09-09 21:02:09 Warning: Warning (2): mysql_connect(): Lost connection to MySQL server at 'reading initial communication packet', system error: 110 in [.../cake/libs/model/datasources/dbo/ dbo_mysql.php, line 540] 2010-09-09 21:02:09 Warning: Warning (2): mysql_select_db() expects parameter 2 to be resource, boolean given in [.../cake/libs/model/ datasources/dbo/dbo_mysql.php, line 546] 2010-09-09 21:02:09 Warning: Warning (2): mysql_query() expects parameter 2 to be resource, boolean given in [.../cake/libs/model/ datasources/dbo/dbo_mysql.php, line 588] 2010-09-09 21:02:09 Warning: Warning (2): mysql_get_server_info() expects parameter 1 to be resource, boolean given in [.../cake/libs/ model/datasources/dbo/dbo_mysql.php, line 554] 2010-09-09 21:02:09 Warning: Warning (2): mysql_real_escape_string() expects parameter 2 to be resource, boolean given in [.../cake/libs/ model/datasources/dbo/dbo_mysql.php, line 655] 2010-09-09 21:02:09 Warning: Warning (2): mysql_query() expects parameter 2 to be resource, boolean given in [.../cake/libs/model/ datasources/dbo/dbo_mysql.php, line 588] 2010-09-09 21:02:09 Warning: Warning (2): mysql_errno() expects parameter 1 to be resource, boolean given in [.../cake/libs/model/ datasources/dbo/dbo_mysql.php, line 667] 2010-09-09 21:02:09 Warning: Warning (2): mysql_query() expects parameter 2 to be resource, boolean given in [.../cake/libs/model/ datasources/dbo/dbo_mysql.php, line 588] 2010-09-09 21:02:09 Warning: Warning (2): mysql_errno() expects parameter 1 to be resource, boolean given in [.../cake/libs/model/ datasources/dbo/dbo_mysql.php, line 667] My database is on another server than the application and for some reason I guess I'm having trouble connecting to it sometimes... My question is... Isn't there a way to "catch" connection errors and prevent the system to perform anything when this happens? I guess that these errors are the cause of anoying problems I'm having like people being able to register with the same username... I know I can use UNIQUE indexes, but I don't know what else could happen with errors like these. Just wish I could block anyhting from being performed if I can't get a connection... Any ideas? What you guys think about it? Thanks! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
