title: Timeout updating DB2 table
body: <p>I am doing an update to a DB2 table like this (java code):</p>
  <pre><code>// Some code  ripped out for brevity...
  sql.append(&quot;UPDATE &quot; + TABLE_THREADS + &quot; &quot;);
  sql.append(&quot;SET STATUS = ? &quot;);
  sql.append(&quot;WHERE ID = ?&quot;);
  
  conn = getConn();
  pstmt = conn.prepareStatement(sql.toString());
  int idx1 = 0;
  pstmt.setInt(++idx1, status);
  pstmt.setInt(++idx1, id);
  int rowsUpdated = pstmt.executeUpdate();
  return rowsUpdated;
  </code></pre>
  <p>After a long while, I get a rollback and an error message:</p>
  <p><code>UNSUCCESSFUL EXECUTION CAUSED BY DEADLOCK OR TIMEOUT. REASON CODE 00C9008E, TYPE OF RESOURCE 00000302, AND RESOURCE NAME SOME.THING.X'000002'. SQLCODE=-913, SQLSTATE=57033, DRIVER=3.57.82</code></p>
  <p>The <a href="http://pic.dhe.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2z9.doc.codes/src/tpc/n913.htm" rel="nofollow noreferrer">documentation for error -913</a> says this REASON CODE means it is a timeout.  The resource type, 00000302 is a table space page, and I do not recognize the resource name at all.</p>
  <p>When I run the SQL by itself, it works fine:</p>
  <pre><code>UPDATE MY.THREADS
  SET STATUS = 1
  WHERE ID = 156
  </code></pre>
  <p>I can <code>SELECT</code> and see the status has been updated.  (Although when I run this SQL during the long wait period before the timeout, I have the same issue.  It takes forever and I just cancel it).</p>
  <p>There are several things happening in the transaction and I don't see any other updates to this table or record.  There are create/delete triggers on the table, but no update triggers.  I don't see any selects with cursors, or weird isolation level changes.  I don't see much else in the transaction that would cause this.</p>
  <p><strong>Why am I getting this error?  What else should I look for in the transaction?</strong></p>
  <hr />
  <h3>EDIT:</h3>
  <p>I stepped through the code from the beginning of the request to where it gets 'stuck'.  It seems as if there are 2 DAO's and both of them are creating a transaction.  I think that might be the problem.</p>