CommandTimeout with DB2 not working

From: Doug Cleven (d_cleven_at_hotmail.com)
Date: 06/08/04


Date: 8 Jun 2004 12:12:14 -0700

I'm using ADO to connect to a DB2 v8.1.5 db running on Linux RH 3.0.
The problem I'm seeing is no exception is thrown when the command
times out.

I am converting an application from using SQL Server to using DB2. I
am using the IBMDADB2 OLE DB connection.
I set the connection->CommandTimeout = 30.
I then expect to catch an exception if the command takes longer than
30 seconds.
This worked fine with SQL Server, but does not with DB2. It simply
returns after 30 seconds with an empty recordset. I create the timeout
by explictiy locking the table (using a DB2 command window) I'm
querying so that the query is blocked.

C++ Code snippets:

strCon.Format(_T("Provider=IBMDADB2;HOSTNAME=%s;PORT=50000;PROTOCOL=TCPIP;Database=%s;UID=%s;PWD=%s;AUTOCOMMIT=0"),
server, database, uid, pw);

spCon->ConnectionString = (LPCTSTR)strCon;
spCon->CommandTimeout = 30;
hrOpen = openConnection(spCon, btEmpty, btEmpty, btEmpty, -1);
...

try
{
// this is where I expect to see the exception thrown when it times
out
HRESULT hr = recordSet->Open(Source, (_Connection*)ActiveConnection,
CursorType,LockType,Options);
return hr;
}
catch(_com_error& e)
{
...
}

d_cleven@hotmail.com



Relevant Pages

  • Re: Revisiting the datagrid data relation issue
    ... I think the exception is thrown when you call ... update method, we can try to handle SqlDataAdapter.RowUpdating event for ... CommandText to see whether the updating command is correct. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: COBOL stored procedure for DB2
    ... Regarding how you precompile the app, you must specify target mfcob to db2 prep, rather than target ibmcob. ... Have you also confirmed that, prior to executing the CALL statement, the host variables specified within the client app have the appropriate values? ... MODIFIES SQL DATA ... confirm the cob command used for creating the SP module. ...
    (comp.lang.cobol)
  • Re: DB2 controlfiles und passwordfiles ?
    ... Welches OS und welche DB2 setzt du denn ein? ... Command Line Processor for DB2 SDK 8.2.0 ... You can issue database manager commands and SQL statements from the ... db2 => connect to sample ...
    (de.comp.datenbanken.misc)
  • IBM DB2 Remote Command Execution Privilege Upgrade (#NISR09032004)
    ... IBM DB2 Remote Command Execution Privilege Upgrade ... allow attackers to gain administrative privileges on the server running DB2. ...
    (NT-Bugtraq)
  • IBM DB2 Remote Command Execution Privilege Upgrade (#NISR09032004)
    ... IBM DB2 Remote Command Execution Privilege Upgrade ... allow attackers to gain administrative privileges on the server running DB2. ...
    (Bugtraq)