OleDb Command Timeout setting is ignored when calling DB2 stored procedure
Posted on 2014-11-03
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.
connectionString="Provider=IBMDADB2;Password=*******;User ID=*******;Data Source=******;Persist Security Info=True;Connect Timeout=1
<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