Weigert, Thomas wrote:
I am not sure why this disconnect causes problems, as at the end of the routine find_calculator the access to the data base is completed. However, if that remains an issue, we have to take the connect and disconnect from the data base out of the find_calculator routine and move it to be beginning and end of the scripts, respectively.
seems to me the every script already has a my $db = create_db_object()
statement to make the connection.
ras [ 15686 ] % ggrep -r 'my $db' *.pl
analyze_backtest.pl: my $db = create_db_object();
backtest.pl:my $db = create_db_object();
backtest_many.pl: my $db = create_standard_object("DB::" . GT::Conf::get("DB::module"));
backtest_multi.pl:my $db = create_standard_object("DB::" . GT::Conf::get("DB::module"));
dev_split_g.pl:my $db = create_standard_object("DB::" . GT::Conf::get("DB::module"));
display_indicator.pl:my $db = create_standard_object("DB::" . GT::Conf::get("DB::module"));
display_signal.pl:my $db = create_standard_object('DB::' . GT::Conf::get('DB::module'));
dump_datasource.pl:my $db = create_standard_object("DB::" . GT::Conf::get("DB::module"));
graphic.19nov06.pl:my $db = create_standard_object("DB::" . GT::Conf::get("DB::module"));
graphic.pl:my $db = create_standard_object("DB::" . GT::Conf::get("DB::module"));
manage_portfolio.pl:my $db = create_db_object();
manage_portfolio.pl: my $db = create_db_object();
new.display_indicator.pl:my $db = create_standard_object("DB::" . GT::Conf::get("DB::module"));
sc_csv2portfolio.pl:my $db = create_db_object();
sc_portgraph.pl:my $db = create_db_object();
scan.pl: my $db = create_standard_object("DB::" . GT::Conf::get("DB::module"));
scan.pl:my $db = create_db_object();
timeframe_names.pl:my $db = create_db_object();
tsv2portfolio.pl:my $db = create_db_object();
furthermore i don't think connections and disconnections stack, either
at the gt level or at the db server level, any disconnect closes them all.
at least that's the way i see it.
ras
That might improve data base performance for the scripts hitting the db multiple times, such as backtest_multi and backtest_many, as well as scan. Th.-----Original Message----- From: Robert A. Schmied [mailto:ras
AT acm.org]
Sent: Tuesday, April 29, 2008 2:46 PM To: devel
AT geniustrader.org
Subject: [GT] trunk/GT/Tools.pm 2008-03-30 04:07:51 UTC (rev 594) or later gt'ers if you are using a sql database, such as postgresql or mysql, and have upgraded from the gt svn repository you need to make the following change to GT/Tools.pm if the revision is between 594 and around 622 or so. in sub find_calculator comment out the line "$db->disconnect;" asshownbelow: die($msg); } my $db = GT::Eval::create_db_object(); my ($prices, $calc) = get_timeframe_data($code, $timeframe, $db, $max_loaded_items); # $db->disconnect; my $c = $prices->count; my $first; ras