/[cvs]/nfo/perl/libs/Data/Storage/Handler/DBI.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Storage/Handler/DBI.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by joko, Thu Dec 19 16:31:05 2002 UTC revision 1.12 by joko, Thu Jan 30 22:28:21 2003 UTC
# Line 3  Line 3 
3  #  $Id$  #  $Id$
4  #  #
5  #  $Log$  #  $Log$
6    #  Revision 1.12  2003/01/30 22:28:21  joko
7    #  + implemented new concrete methods
8    #
9  #  Revision 1.11  2002/12/19 16:31:05  joko  #  Revision 1.11  2002/12/19 16:31:05  joko
10  #  + sub dropDb  #  + sub dropDb
11  #  + sub rebuildDb  #  + sub rebuildDb
# Line 313  sub rebuildDb { Line 316  sub rebuildDb {
316    return $res;    return $res;
317  }  }
318    
319    sub testAvailability {
320      my $self = shift;
321      my $status = $self->testDsn();
322      $self->{locator}->{status}->{available} = $status;
323      return $status;
324    }
325    
326    sub testDsn {
327      my $self = shift;
328      my $dsn = $self->{locator}->{dbi}->{dsn};
329      my $result;
330      if ( my $dbh = DBI->connect($dsn, '', '', {
331                                                          PrintError => 0,
332                                                          } ) ) {
333        
334        # TODO: REVIEW
335        $dbh->disconnect();
336        
337        return 1;
338      } else {
339        $logger->warning( __PACKAGE__ .  "[$self->{locator}->{type}]" . "->testDsn(): " . "DBI-error: " . $DBI::errstr );
340      }
341    }
342    
343  1;  1;
344    __END__

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed