3 |
# $Id$ |
# $Id$ |
4 |
# |
# |
5 |
# $Log$ |
# $Log$ |
6 |
|
# Revision 1.7 2003/01/30 22:21:52 joko |
7 |
|
# + changed 'connect'-behaviour back to old state |
8 |
|
# + renamed log-output (now using 'initializing' instead of 'booting' - corresponding to 'initStorage') |
9 |
|
# |
10 |
# Revision 1.6 2003/01/30 21:44:00 joko |
# Revision 1.6 2003/01/30 21:44:00 joko |
11 |
# + temporary fix: (FIXME) now connecting to storage on storagehandle-instantiation |
# + temporary fix: (FIXME) now connecting to storage on storagehandle-instantiation |
12 |
# |
# |
155 |
my $name = shift; |
my $name = shift; |
156 |
|
|
157 |
my $locator = $self->getLocator($name); |
my $locator = $self->getLocator($name); |
158 |
$logger->info( __PACKAGE__ . " is booting storage declared by locator \"$name\"" ); |
$logger->info( __PACKAGE__ . " is initializing storage declared by locator \"$name\"" ); |
159 |
|
|
160 |
my $storage = Data::Storage->new($locator); |
my $storage = Data::Storage->new($locator); |
161 |
|
|
162 |
# TODO: do below (after 'testAvailability' and 'testIntegrity') again!!! |
# TODO: do below (after 'testAvailability' and 'testIntegrity') again!!! |
163 |
$storage->connect(); |
#$storage->connect(); |
164 |
|
|
165 |
my $log_prefix = __PACKAGE__ . "->initStorage: "; |
my $log_prefix = __PACKAGE__ . "->initStorage: "; |
166 |
$log_prefix .= "dsn=\"$self->{locator}->{$name}->{dsn}\"" if $self->{locator}->{$name}->{dsn}; |
$log_prefix .= "dsn=\"$self->{locator}->{$name}->{dsn}\"" if $self->{locator}->{$name}->{dsn}; |
188 |
# don't connect right here, do an implicit connect on (later) usage |
# don't connect right here, do an implicit connect on (later) usage |
189 |
# maybe set ->{meta}->{connectmethod} = "connect" here |
# maybe set ->{meta}->{connectmethod} = "connect" here |
190 |
#return unless $storage->connect(); |
#return unless $storage->connect(); |
191 |
#$storage->connect() if $locator->{status}->{integrity}; |
$storage->connect() if $locator->{status}->{integrity}; |
192 |
|
|
193 |
# should we check emptyness? |
# should we check emptyness? |
194 |
if ($locator->{status}->{availability} && $locator->{test_emptyness}) { |
if ($locator->{status}->{availability} && $locator->{test_emptyness}) { |