Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: DBIx::Class connection

by morgon (Priest)
on Jan 03, 2011 at 01:22 UTC ( [id://880108]=note: print w/replies, xml ) Need Help??


in reply to Re: DBIx::Class connection
in thread DBIx::Class connection

As always many thanks for sharing your knowledge, mother.

And to log the SQL that is generated I could simply subclass DBIx::Class::Storage::Statistics and set it as debugobj I guess?

And while I am at it (and don't want to experiment when I can simply ask mother):

I don't quite understand what happens when the database-connection is lost (I am using mysql).

I understand DBIx::Class will try to reconnect automatically - does that mean it will try once and give up if it fails to reconnect or what exactly happens?

How could I trace (assumed I cared) when a connection is lost and re-established?

Many thanks.

Replies are listed 'Best First'.
Re^3: DBIx::Class connection
by Your Mother (Archbishop) on Jan 03, 2011 at 03:26 UTC

    Look at DBIx::Class::QueryLog and Log::Log4perl::Appender::DBIx::Class and the trace section of DBI. I think you can do pretty deep logging but I've never tried and when I've needed a log I've generally used DBI->trace to a tmp file.

    I also am not sure how the reconnection stuff is is handled. I've been lucky enough that it's always "just worked" for everything I've done. You could dive the guts of the relevant Storage/Engine modules though I suspect the reconnect stuff is (at least partly) handled in the relevant DBD modules.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-04-23 17:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found