djzort has asked for the wisdom of the Perl Monks concerning the following question:
I have crafted an application in Catalyst using the Catalyst::Model::DBI model. The problem i am having is that if the mysql connection is lost, the connection is not automatically restablished.
debug Connected to the database using DBIx::Connector via dsn:dbi:mysql:dbname=foo;host=127.0.0.1 debug Response Code: 200; Content-Type: text/html; Content-Length: 100796 info Request took 0.670558s (1.491/s) .------------------------------------------------------------+-----------. | Action | Time | +------------------------------------------------------------+-----------+ | /index | 0.643402s | | /end | 0.018165s | | -> Foo::View::HTML->process | 0.012999s | '------------------------------------------------------------+-----------' DBD::mysql::st execute failed: MySQL server has gone away at /home/XXXXXX/Foo/script/../lib/Foo/Model/Bar.pm line 595. DBD::mysql::db selectall_arrayref failed: MySQL server has gone away at /home/XXXXXX/Scamps/script/../lib/Foo/Model/Bar.pm line 454.Curiously, using Catalyst::Model::DBIx::Connector solves the problem. Which is strange as both models use DBIx::Connector
Scouring through their respective code, its not obvious why this isnt being caight properly and handled in Catalyst::Model::DBI
The internals of DBIx::Connector override attempts to set mysql_auto_reconnect
I am seeing the same behaviour in both foo_server.pl and via mod_perl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Catalyst::Model::DBI not reconnecting? ( MySQL server has gone away )
by Anonymous Monk on Dec 12, 2013 at 09:13 UTC |