Solved

OleDb Command Timeout setting is ignored when calling DB2 stored procedure

Posted on 2014-11-03
8
549 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 50

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 50

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 50

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle Mulit-site configuration 28 73
Make borderless form movable by user 2 26
Database (Access Table) Security Access 8 57
VB .net 2010 Byte array 2 21
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
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 …

732 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