05-31-2010 01:54 PM
I've ported some code over from LabVIEW7.1 to 8.6 which updates a table in a MYSQL database. The problem is that the new code leaves a database connection open after execution (while the 7.1 code does not). I would like to know if anyone has seen this behavior and if they know a fix, and if not, how would they go about debugging this problem.
I am using the MYSQL ODBC connector, version 5.1.
Some observations:
1. This vi is part of a TestStand 4.2 sequence, and the sequence writes results at the end of testing using TestStand's built in functionality to do this. What's notable is that unlike the vi, the database connection used to write the results is closed properly.
2. I've used the "trace" tool in windows ODBC panel but the information is overwhelming large, cryptic and doesn't contain recognizable strings. To reduce the size of the file I tried to start and stop it so that it was tracing only during the execution of the vi.
This didn't work - the tool did not record any information.
3. Stepping through the vi...
a. The database connection problem does not appear.
b. The error cluster is always empty indicating no errors have ocurred.
4. No errors happen during normal execution.
5. I've added delays of 5 seconds between some of the database vi calls and still the database connection is left open.
The vi that's causing the problem is attached.
Thanks in advance.
05-31-2010 02:45 PM
06-01-2010 02:41 PM
06-04-2010 04:53 PM
I've replace the double quotes with single quotes and unfortunately the vi to close the database connection isn't working.
Does anyone have any other ideas? Is there a low level or debug version of the database connectivity vi's that I can use? I need some debug capability here.
06-04-2010 04:59 PM
06-04-2010 05:35 PM
My advice is to get rid of the sequence structure and either string everything along left to right, or preferably use a state machine. Turn on highlighting and look for an error condition on the error wires. Maybe put a probe on the DB reference wire and compare what you see to the value after the DB open function. An improper reference or an error could cause the DB to not close.
06-04-2010 05:56 PM
06-04-2010 06:09 PM
No problem when stepping through the code and having a problem when running at full speed suggests a timing problem. Try putting delays at various places.
06-04-2010 07:53 PM
06-04-2010 07:55 PM