Setting Query Timeout in Windows .NET ODBC Connection String

1,268 views
Skip to first unread message

Jim Dolson

unread,
Apr 24, 2011, 9:43:03 PM4/24/11
to ensemble-in-healthcare
I have a VB .NET application that queries a Cache database.  My connection string is similar to:
 
conn.Open "DRIVER={InterSystems ODBC};SERVER=192.168.0.128;PORT=1972;DATABASE=ENSHHDEV;UID=jim.dolson;PWD=blarg;"
 
Queries that take longer than 30 seconds time out.  I know that I if I defined a DSN in the Windows ODBC setup tool that I could check the "Ignore ODBC Timeout" option.  However, I would like to do this using an connection string.
 
I've tried various options that I've found on the web, but none of them are working:
 
Command Timeout=0;
Default Command Timeout=0;
Query Timeout=0;
and also the above with spaces removed just for grins.
 
Either disabling the query timeout or the ability to set a longer than 30 second query timeout would solve my problem.
 
Any suggestions?
 
Thanks!
 
Jim Dolson
 
 

James MacKeith

unread,
Apr 25, 2011, 9:41:33 AM4/25/11
to ensemble-in...@googlegroups.com

Hi Jim

 

I understand the “Query Timeout” setting actually means Disable Query Timeout. In 2009.1 we added the connection keyword “Disable Query Timeout”

 

Can you try using

 

Query Timeout = 1

 

in the connection string.

 

Apologies for the confusion if this addresses it. If not let me know and I’ll pursue.

 

All the best

 

James

--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en

Jim Dolson

unread,
Apr 25, 2011, 9:13:59 PM4/25/11
to ensemble-in...@googlegroups.com
Hi James.
 
That did not work.  I tried:
 
Query Timeout = 1;
and
QueryTimeout=1;
 
The result was the same.  The query times out after 30 seconds. 
 
I'm using InterSystems ODBC 2009.01.06.921
 
Thanks for any additional thoughts.
 
Jim

James MacKeith

unread,
Apr 26, 2011, 8:21:30 AM4/26/11
to ensemble-in...@googlegroups.com

Thanks Jim

 

Sorry to hear.

 

I have it working using

 

Dim ConnString = "DRIVER={InterSystems ODBC};SERVER=127.0.0.1;PORT=56776;DATABASE=SAMPLES;UID=_SYSTEM;PWD=SYS;Query Timeout=1;"

Dim Conn As OdbcConnection

Conn = New OdbcConnection(ConnString)

Conn.Open()

 

And where I put a Hang 120 in the SqlComputeCode for one field.

 

I’ll speak to my colleagues on the ODBC side since I was using a later ODBC driver but I can’t see any reports of this not working with a  2009 ODBC driver.

 

Best wishes

Jim Dolson

unread,
Apr 26, 2011, 8:54:05 AM4/26/11
to ensemble-in...@googlegroups.com, ensemble-in...@googlegroups.com
Thanks James.  I'll update to a 2010 driver and see if that solves my problem.

Jim
Reply all
Reply to author
Forward
0 new messages