Keep It Simple, Stupid | |
PerlMonks |
Catalyst::Model::DBI not reconnecting?by djzort (Sexton) |
on Dec 11, 2013 at 22:57 UTC ( [id://1066742]=perlquestion: print w/replies, xml ) | Need Help?? |
djzort has asked for the wisdom of the Perl Monks concerning the following question:
Morning/Evening/Afternoon all
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
Back to
Seekers of Perl Wisdom
|
|