Beefy Boxes and Bandwidth Generously Provided by pair Networks
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

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1066742]
Approved by taint
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (9)
As of 2024-03-28 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found