Commit a63e0880 authored by Leo Gordon's avatar Leo Gordon
Browse files

reload the cached data_dbc() value on change of param('db_conn')

parent 163f7250
......@@ -377,13 +377,16 @@ sub dbc {
=cut
sub data_dbc {
my $self = shift;
my $self = shift @_;
my $given_db_conn = shift @_ || $self->param('db_conn') || $self;
if(@_ or !$self->{'_data_dbc'}) {
$self->{'_data_dbc'} = $self->go_figure_dbc( shift @_ || $self->param('db_conn') || $self->dbc );
if( !$self->{'_cached_db_conn'} or $self->{'_cached_db_conn'}!=$given_db_conn) {
$self->{'_cached_db_conn'} = $given_db_conn;
$self->{'_cached_data_dbc'} = $self->go_figure_dbc( $given_db_conn );
}
return $self->{'_data_dbc'};
return $self->{'_cached_data_dbc'};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment