Rose::DBx::AutoReconnect - Rose::DB with auto-reconnect to server


Rose-DBx-AutoReconnect documentation  | view source Contained in the Rose-DBx-AutoReconnect distribution.

Index


NAME

Top

Rose::DBx::AutoReconnect - Rose::DB with auto-reconnect to server

SYNOPSIS

Top

 use Rose::DBx::AutoReconnect;
 my $db = Rose::DBx::AutoReconnect->new;
 $db->logger('hello world');

DESCRIPTION

Top

Rose::DBx::AutoReconnect is a subclass of Rose::DB. Additional features include:

If using new_or_cached() method, will ping() dbh on every fetch from cache to ensure that the dbh is connected. This extends the basic Rose::DB::Cache behaviour beyond mod_perl/Apache::DBI.

Convenient logger() method for debugging.

Always uses DBI connect_cached() method when creating handles.

Rose::DBx::AutoReconnect was written to allow new_or_cached() to work with MySQL's "morning bug" and to allow for restarting your database without restarting your application. See also Rose::DBx::Cache::Anywhere.

METHODS

Top

init_logfh

Defaults to STDERR. Get/set it with logfh().

init_debug

Defaults to value of PERL_DEBUG env var (if set) or 0 (false). Get/set it with debug().

logger( msg )

Writes msg to the filehandle set with logfh().

loglabel

Returns a pretty timestamp and label. Used by logger().

nick

Returns pretty label unique to this DB object. Used by loglabel().

dbi_connect

Override base method to use DBI connect_cached() method.

AUTHOR

Top

Peter Karman, <karman at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-rose-dbx-autoreconnect at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Rose-DBx-AutoReconnect. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Rose::DBx::AutoReconnect

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Rose-DBx-AutoReconnect

* CPAN Ratings

http://cpanratings.perl.org/d/Rose-DBx-AutoReconnect

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Rose-DBx-AutoReconnect

* Search CPAN

http://search.cpan.org/dist/Rose-DBx-AutoReconnect

ACKNOWLEDGEMENTS

Top

The Minnesota Supercomputing Institute http://www.msi.umn.edu/ sponsored the development of this software.

COPYRIGHT

Top


Rose-DBx-AutoReconnect documentation  | view source Contained in the Rose-DBx-AutoReconnect distribution.