title: Exception while running number of queries concurrently on DB2
body: <p>We are testing an application specific Design where we need to show progressive counts after firing many queries simultaneously.</p>
  
  <p>When we are firing a single query, we are successfully able to get Results Asynchronously.</p>
  
  <p>But, when we are firing 3-4 queries simultaneously, after a significant amount of time &amp; after getting some records for each query
  we are getting an exception which states</p>
  
  <p><strong>“com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -1218, SQLSTATE: 57011, SQLERRMC: 4099”</strong></p>
  
  <p>Because of this, all the queries fired do not get executed completely.</p>
  
  <p>There is no problem if these queries are fired one by one. (query2 starts executing after query1 completes &amp; so on)</p>
  
  <p>After looking for this SQLCODE in Control Center we found out the details which are, </p>
  
  <hr>
  
  <p>SQL1218N  There are no pages currently available in bufferpool</p>
  
  <pre><code>  "&lt;buffpool-num&gt;".
  </code></pre>
  
  <p>Explanation: </p>
  
  <p>All of the pages in the bufferpool are currently being used. A request
  to use another page failed.</p>
  
  <p>The statement may be successful if executed again. If this error occurs
  frequently, some or all of the following actions may prevent further
  failures: </p>
  
  <ol>
  <li><p>increase the bufferpool size</p></li>
  <li><p>decrease the maximum number of database agents and/or connections</p></li>
  <li><p>decrease the maximum degree of parallelism</p></li>
  <li><p>decrease the prefetch size for table spaces that are in this</p>
  
  <p>bufferpool</p></li>
  <li><p>move some table spaces into other bufferpools.</p>
  
  <p>sqlcode: -1218</p>
  
  <p>sqlstate: 57011</p></li>
  </ol>
  
  <hr>
  
  <p>On our DB instance, we already had a buffer pool of 32K page size &amp; even after creating another buffer pool
  of 32K, the problem persists.</p>
  
  <p>Can anyone kindly help us in solving the problem.</p>
  
  <p>Thanks &amp; Regards,</p>
  
  <p>Ravindra Jain</p>