kivitendo/SL/DB/Helper/Cache.pm @ 27bba4dc
b9d5cb7b | Moritz Bunkus | package SL::DB::Helper::Cache;
|
||
d17039f0 | Moritz Bunkus | |||
use strict;
|
||||
use warnings;
|
||||
use Carp;
|
||||
use parent qw(Rose::DB::Cache);
|
||||
sub prepare_db {
|
||||
my ($self, $db, $entry) = @_;
|
||||
if (!$entry->is_prepared) {
|
||||
# if this a dummy kivitendo dbh, don't try to actually prepare this.
|
||||
if ($db->type =~ /KIVITENDO_EMPTY/) {
|
||||
return;
|
||||
}
|
||||
$entry->prepared(1);
|
||||
}
|
||||
if (!$db->dbh->ping) {
|
||||
$db->dbh(undef);
|
||||
}
|
||||
}
|
||||
1;
|
||||
__END__
|
||||
=head1 NAME
|
||||
b9d5cb7b | Moritz Bunkus | SL::DB::Helper::Cache - database handle caching for kivitendo
|
||
d17039f0 | Moritz Bunkus | |||
=head1 DESCRIPTION
|
||||
This class provides database cache handling for kivitendo running
|
||||
under FastCGI. It's based on Rose::DBx::Cache::Anywhere.
|
||||
=head1 METHODS
|
||||
=head2 prepare_db( I<rose_db>, I<entry> )
|
||||
Overrides default method to always ping() dbh.
|