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


In reply to Catalyst::Model::DBI not reconnecting? by djzort

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.