[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [GT] Re: gt-d] Trouble with backtest.pl and beancounter



I have installed beancounter and PG on my system to look at this problem.

 

It turns out that throughout GT there are locations where a data base is reused via a shared “our” variable. While it appears when one looks at the code that the $db reference is assigned to a “my” variable, in fact the content of that variable is retrieved from the shared reference. Therefore, the disconnect from the data base must be done only once, as there are situations where the assumption is being made that the data base has already been connected to. While this is not very safe, and not documented, it does imply that we must make the assumption that the data base should be connected to in the script and disconnected from at the end of the script.

 

Commenting the disconnect out won’t do much harm, but the better way will be to migrate the disconnect back into the scripts.

 

On cygwin (the environment I am running, I am getting problems with fork and db access, so there are issues with running scan.pl with beancounter. Thus I have not been able to look at scan.pl, due to that problem.

 

Th.

 

From: Nicholas Kuechler [mailto:nkuechler AT gmail.com]
Sent: Tuesday, April 29, 2008 2:45 PM
To: devel AT geniustrader.org
Subject: Re: [GT] Re: gt-d] Trouble with backtest.pl and beancounter

 

With Roberts help, we found the DB disconnect in GT/Tools.pm appears to be causing this problem.

I've commented it out for now:

  #$db->disconnect;

I'm not sure commenting it out complete is "ideal" but I'm not sure where else to place this line of code to produce a working solution.