Solved

OleDb Command Timeout setting is ignored when calling DB2 stored procedure

Posted on 2014-11-03
8
512 Views
Last Modified: 2014-11-18
My .NET application is calling a DB2 stored procedure (z/os).
I set the command timeout to 1 second.  I set up the stored procedure to delay for 10 seconds and then process.
I would expect the .NET application to return an error after 1 second, but it does not.  It continues waiting for the stored procedure to complete.
 
Connection String
 connectionString="Provider=IBMDADB2;Password=*******;User ID=*******;Data Source=******;Persist Security Info=True;Connect Timeout=1

Command
 <add key="CommandTimeout"  value="1"/>
 iCommandTimeout = Ctype(ConfigurationManager.AppSettings("CommandTimeout").ToString, Int32)

Dim command As New OleDbCommand(strTableOwner & "." & sStoredProcToCall, conn)
            command.CommandTimeout = iCommandTimeout
            command.CommandType = CommandType.StoredProcedure
0
Comment
Question by:Jeanne_Kornkven
  • 3
  • 3
8 Comments
 
LVL 27

Expert Comment

by:tliotta
ID: 40436346
Please explain what you mean by "I set up the stored procedure to delay for 10 seconds and then process." AFAIK, that doesn't seem related to whether or not a Connect Timeout=1 will be signaled. A connection probably happens in less than a second.

Tom
0
 

Author Comment

by:Jeanne_Kornkven
ID: 40436602
Tom, I also set the Command Timeout to 1 second, and that is what I am trying to test.
0
 
LVL 47

Expert Comment

by:Vitor Montalvão
ID: 40446897
The connection timeout is the time that the application is waiting for a connection to be opened on the server and not the maximum time allowed for a query to run. The server didn't throw an error because it could got connected in less than 1 second.
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

Author Comment

by:Jeanne_Kornkven
ID: 40447563
Vitor, I also set the Command Timeout to 1 second, and that is what I am trying to test.  Sorry if my example was confusing.
0
 
LVL 47

Expert Comment

by:Vitor Montalvão
ID: 40447623
Jeanne, hi just realize now. Sorry, my fault.
Command timeout it's the maximum time waiting for a response from the server. Since you have a SP delaying 10 seconds I would say that while there's feedback from the server, won't throw a timeout error. I mean, from the DB side it's waiting for 10 seconds but the server is still communicating with your application.
You would test it better with a long running query than something that only do a pause.
0
 

Author Comment

by:Jeanne_Kornkven
ID: 40448051
Vitor, I am calling  a COBOL stored procedure on the IBM mainframe.  So we are actually inside the COBOL program when the delay is happening.  I did actually try a pause first, which had the same result.
0
 
LVL 47

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 40449191
Jeanne, it was what I said. Don't test with delay/pause. You need to test with queries. Try with a query that you know will take long to be executed.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How do you do a one to many list in .NET CORE? 2 28
Alert on Server memory 2 24
.NET 2008 VB and C# 6 28
MailAddress in vb 4 15
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question