Solved

OleDb Command Timeout setting is ignored when calling DB2 stored procedure

Posted on 2014-11-03
8
455 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
Comment Utility
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
Comment Utility
Tom, I also set the Command Timeout to 1 second, and that is what I am trying to test.
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:Jeanne_Kornkven
Comment Utility
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 45

Expert Comment

by:Vitor Montalvão
Comment Utility
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
Comment Utility
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 45

Accepted Solution

by:
Vitor Montalvão earned 500 total points
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now