LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

database connectivity timeout

Hello,

 

   I'm using the database connectivity toolkit to connect to a MySQL database. If the database isn't there or there is a mistake in an SQL query after I have connected my program takes 15s (the default) to realise. I've tried wiring different values to the connection timeout node but this doesn't seem to make any difference whatsoever. I've hacked the first problem by pinging the machine with the DB on before trying to connect as suggested in another post, but this doesn't help if I screw up my INSERT syntax... any ideas what could be wrong?

 

       Cheers,

 

              Tim

 

   

0 Kudos
Message 1 of 5
(4,803 Views)

Hi Tim,


You should be able to use the command timeout (s) parameter of the DB Tools Set Properties VI of the Database Connectivity Toolkit to set the maximum time to wait for a command to execute, in seconds.


connection_properties.png

Regards,


Imtiaz Chowdhury
Project Manager
Green Running / Austin Consultants

0 Kudos
Message 2 of 5
(4,768 Views)

Thanks Imtiaz, that's sorted my problems - I don't suppose you have any idea why the timeout value I'm wiring to the Open Connection VI isn't working? I can't set the connection properties as you suggest until after the connection is open so I'm still having to check for the presence of the DB machine before opening.

 

   Cheers,

 

           Tim

0 Kudos
Message 3 of 5
(4,732 Views)
That timeout value is explicitedly for the Open operation itself. The server could be slow to answer, or behind many low speed network connections or as in your first problem not even listening at the address you provided, so there is a use for that.
Message Edited by rolfk on 11-22-2009 01:44 PM
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 5
(4,710 Views)
I had the same problem with the database connection timeout not working, so I created this VI to check for connectivity before opening a connection.
Message Edited by LabBEAN on 02-19-2010 06:17 PM

Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
0 Kudos
Message 5 of 5
(4,531 Views)